A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ruby/spec/commit/e4db1d326bebbd33e47c046e810968b4236aa4ec below:

Add specs for rb_struct_define · ruby/spec@e4db1d3 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+12

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+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