File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
spec/recursive_open_struct Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 108
108
it { expect ( subject . methods . map ( &:to_sym ) ) . to_not include :asdf= }
109
109
end # describe #methods
110
110
end # describe handling of arbitrary attributes
111
+
112
+ describe "handling of freezing" do
113
+ let ( :hash ) { { :asdf => 'John Smith' } }
114
+
115
+ before do
116
+ ros . freeze
117
+ end
118
+
119
+ it "can read existing keys" , pending : 'Awaiting fix' do
120
+ expect ( ros . asdf ) . to eq 'John Smith'
121
+ end
122
+
123
+ it "cannot write new keys" do
124
+ expect { ros . new_key = 'new_value' } . to raise_error FrozenError
125
+ end
126
+
127
+ it "cannot write existing keys" do
128
+ expect { ros . asdf = 'new_value' } . to raise_error FrozenError
129
+ end
130
+ end
111
131
end # describe behavior it inherits from OpenStruct
112
132
end
You can’t perform that action at this time.
0 commit comments