test/options_test.rb in rtomayko-rack-cache-0.2.0 vs test/options_test.rb in rtomayko-rack-cache-0.3.0
- old
+ new
@@ -5,42 +5,45 @@
option_accessor :foo
end
class MockOptions
include Rack::Cache::Options
- alias_method :initialize, :initialize_options
+ def initialize
+ @env = nil
+ initialize_options
+ end
end
describe 'Rack::Cache::Options' do
before { @options = MockOptions.new }
describe '#set' do
it 'sets a Symbol option as rack-cache.symbol' do
@options.set :bar, 'baz'
- @options.options['rack-cache.bar'].should.be == 'baz'
+ @options.options['rack-cache.bar'].should.equal 'baz'
end
it 'sets a String option as string' do
@options.set 'foo.bar', 'bling'
- @options.options['foo.bar'].should.be == 'bling'
+ @options.options['foo.bar'].should.equal 'bling'
end
it 'sets all key/value pairs when given a Hash' do
@options.set :foo => 'bar', :bar => 'baz', 'foo.bar' => 'bling'
- @options.foo.should.be == 'bar'
- @options.options['rack-cache.bar'].should.be == 'baz'
- @options.options['foo.bar'].should.be == 'bling'
+ @options.foo.should.equal 'bar'
+ @options.options['rack-cache.bar'].should.equal 'baz'
+ @options.options['foo.bar'].should.equal 'bling'
end
end
it 'makes options declared with option_accessor available as attributes' do
@options.set :foo, 'bar'
- @options.foo.should.be == 'bar'
+ @options.foo.should.equal 'bar'
end
it 'allows setting multiple options via assignment' do
@options.options = { :foo => 'bar', :bar => 'baz', 'foo.bar' => 'bling' }
- @options.foo.should.be == 'bar'
- @options.options['foo.bar'].should.be == 'bling'
- @options.options['rack-cache.bar'].should.be == 'baz'
+ @options.foo.should.equal 'bar'
+ @options.options['foo.bar'].should.equal 'bling'
+ @options.options['rack-cache.bar'].should.equal 'baz'
end
it 'allows the meta store to be configured' do
@options.should.respond_to :metastore
@options.should.respond_to :metastore=