Skip to content

Commit

Permalink
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby/core/regexp/new_spec.rb
Original file line number Diff line number Diff line change
@@ -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.