Skip to content

Commit

Permalink
Add specs for Rubinius::Thunk#value accessors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jemc committed Jun 8, 2015
1 parent c3974af commit c9bce4b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/core/module/thunk_method_spec.rb
Expand Up @@ -20,4 +20,17 @@
it "returns the coerced name" do
@class.thunk_method("a_reader", @value).should equal(:a_reader)
end

it "creates an executable that can be used to read the value" do
@class.thunk_method(:thunk, @value)
@class.instance_metho(d:thunk).executable.value.should equal(@value)
end

it "creates an executable that can be used to change the value" do
@class.thunk_method(:thunk, @value)
new_value = Object.new
@class.instance_method(:thunk).executable.value = new_value
@class.instance_method(:thunk).executable.value.should equal(new_value)
@class.new.thunk.should equal(new_value)
end
end

0 comments on commit c9bce4b

Please sign in to comment.