diff options
Diffstat (limited to 'spec/ruby/library/openstruct/element_reference_spec.rb')
| -rw-r--r-- | spec/ruby/library/openstruct/element_reference_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/ruby/library/openstruct/element_reference_spec.rb b/spec/ruby/library/openstruct/element_reference_spec.rb new file mode 100644 index 0000000000..c425991b0f --- /dev/null +++ b/spec/ruby/library/openstruct/element_reference_spec.rb @@ -0,0 +1,13 @@ +require_relative '../../spec_helper' +require "ostruct" + +describe "OpenStruct#[]" do + before :each do + @os = OpenStruct.new + end + + it "returns the associated value" do + @os.foo = 42 + @os[:foo].should == 42 + end +end |
