+12
-0
lines changedFilter options
+12
-0
lines changed Original file line number Diff line number Diff line change
@@ -65,6 +65,18 @@
65
65
@struct = @klass.new
66
66
end
67
67
68
+
describe "rb_struct_define" do
69
+
ruby_version_is "2.2" do
70
+
it "raises an ArgumentError if arguments contain duplicate member name" do
71
+
lambda { @s.rb_struct_define(nil, "a", "b", "a") }.should raise_error(ArgumentError)
72
+
end
73
+
end
74
+
75
+
it "raises a NameError if an invalid constant name is given" do
76
+
lambda { @s.rb_struct_define("foo", "a", "b", "c") }.should raise_error(NameError)
77
+
end
78
+
end
79
+
68
80
describe "rb_struct_aref" do
69
81
it "returns the value of a struct member with a symbol key" do
70
82
@struct[:a] = 2
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4