Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Don't allow array parameter in Struct.new
- Loading branch information
1 parent
a630c4f
commit b60d6c42aaa10ac99a03a92a3a34da4bee066af1
Showing
2 changed files
with
14 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -158,3 +158,9 @@ | ||
assert_equal 1, a.dig(:purple, :red) | ||
assert_equal 1, a.dig(1, 0) | ||
end | ||
|
||
assert("Struct.new does not allow array") do | ||
assert_raise(TypeError) do | ||
Struct.new("Test", [:a]) | ||
end | ||
end |