Skip to content

Commit

Permalink
add test for using set with a block
Browse files Browse the repository at this point in the history
  • Loading branch information
trans committed Feb 5, 2010
1 parent 15651d9 commit 0915274
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/settings_test.rb
Expand Up @@ -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',
Expand Down

0 comments on commit 0915274

Please sign in to comment.