Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c9bce4b

Browse files
committedJun 8, 2015
Add specs for Rubinius::Thunk#value accessors.
1 parent c3974af commit c9bce4b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎spec/core/module/thunk_method_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,17 @@
2020
it "returns the coerced name" do
2121
@class.thunk_method("a_reader", @value).should equal(:a_reader)
2222
end
23+
24+
it "creates an executable that can be used to read the value" do
25+
@class.thunk_method(:thunk, @value)
26+
@class.instance_metho(d:thunk).executable.value.should equal(@value)
27+
end
28+
29+
it "creates an executable that can be used to change the value" do
30+
@class.thunk_method(:thunk, @value)
31+
new_value = Object.new
32+
@class.instance_method(:thunk).executable.value = new_value
33+
@class.instance_method(:thunk).executable.value.should equal(new_value)
34+
@class.new.thunk.should equal(new_value)
35+
end
2336
end

0 commit comments

Comments
 (0)
Please sign in to comment.