Skip to content

Commit

Permalink
Merge pull request #34 from locaweb/make-test-deterministic
Browse files Browse the repository at this point in the history
Fix a spec of execution order problem
  • Loading branch information
fabioperrella authored Jun 27, 2019
2 parents df23aa0 + 6ca8fa4 commit cab3da3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/cassette_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def keeping_logger(&block)

context 'when the cache_backend is not set' do
it 'returns Rails.cache if set' do
described_class.cache_backend = nil
rails_cache = double('cache')
rails = double('Rails')
allow(rails).to receive(:cache).and_return(rails_cache)
Expand All @@ -63,6 +64,8 @@ def keeping_logger(&block)
end

it 'returns MemoryStore if Rails.cache not set' do
described_class.cache_backend = nil

# exercise and verify
expect(described_class.cache_backend).to be_a(ActiveSupport::Cache::MemoryStore)

Expand All @@ -71,6 +74,7 @@ def keeping_logger(&block)
end

it 'returns NullStore if Rails.cache and MemoryStore are not set' do
described_class.cache_backend = nil
hide_const('ActiveSupport::Cache::MemoryStore')
require 'cassette/cache/null_store'

Expand Down

0 comments on commit cab3da3

Please sign in to comment.