Skip to content

Commit

Permalink
Reintroduce Number arg specs for Regexp.new
Browse files Browse the repository at this point in the history
Like done in @7981f2c05671722dcf12f0d4f6bceb46cef29ff5
  • Loading branch information
tak1n committed May 24, 2015
1 parent 621953b commit cbae591
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby/core/regexp/new_spec.rb
Expand Up @@ -16,3 +16,15 @@
it_behaves_like :regexp_new_regexp_ascii, :new
it_behaves_like :regexp_new_regexp_ascii_8bit, :new
end

describe "Regexp.new given a Fixnum" do
it "raises a TypeError" do
lambda { Regexp.new(1) }.should raise_error(TypeError)
end
end

describe "Regexp.new given a Float" do
it "raises a TypeError" do
lambda { Regexp.new(1.0) }.should raise_error(TypeError)
end
end

0 comments on commit cbae591

Please sign in to comment.