Skip to content

Commit cbae591

Browse files
committedMay 24, 2015
Reintroduce Number arg specs for Regexp.new
Like done in @7981f2c05671722dcf12f0d4f6bceb46cef29ff5
1 parent 621953b commit cbae591

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

Diff for: ‎spec/ruby/core/regexp/new_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,15 @@
1616
it_behaves_like :regexp_new_regexp_ascii, :new
1717
it_behaves_like :regexp_new_regexp_ascii_8bit, :new
1818
end
19+
20+
describe "Regexp.new given a Fixnum" do
21+
it "raises a TypeError" do
22+
lambda { Regexp.new(1) }.should raise_error(TypeError)
23+
end
24+
end
25+
26+
describe "Regexp.new given a Float" do
27+
it "raises a TypeError" do
28+
lambda { Regexp.new(1.0) }.should raise_error(TypeError)
29+
end
30+
end

0 commit comments

Comments
 (0)