1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

add test for using set with a block

This commit is contained in:
7rans 2010-02-05 15:12:28 -05:00
parent 15651d9ee1
commit 0915274b69

View file

@ -21,6 +21,19 @@ class SettingsTest < Test::Unit::TestCase
assert_equal 'baz', @base.foo
end
it 'sets settings using a block' do
@base.set(:foo){ 'baz' }
assert @base.respond_to?(:foo)
assert_equal 'baz', @base.foo
end
# TODO: should it raise an error instead?
it 'ignores any other value if set using a block' do
@base.set(:foo, 'ignore'){ 'baz' }
assert @base.respond_to?(:foo)
assert_equal 'baz', @base.foo
end
it "sets multiple settings with a Hash" do
@base.set :foo => 1234,
:bar => 'Hello World',