diff options
author | Benoit Daloze <[email protected]> | 2020-06-27 15:51:37 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-06-27 15:51:37 +0200 |
commit | b3fa158d1c4d8e03b8dc04f1e4f9940a8a4ef44c (patch) | |
tree | fa8a62d6192c24a21e70aa02589507adfe4e4e6a /spec/ruby/optional/capi/regexp_spec.rb | |
parent | 64d8c0815e6ab042e8a67a670bda9f34404fa662 (diff) |
Update to ruby/spec@b6b7752
Diffstat (limited to 'spec/ruby/optional/capi/regexp_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/regexp_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/ruby/optional/capi/regexp_spec.rb b/spec/ruby/optional/capi/regexp_spec.rb index 52aae6bb01..d99935da57 100644 --- a/spec/ruby/optional/capi/regexp_spec.rb +++ b/spec/ruby/optional/capi/regexp_spec.rb @@ -9,12 +9,20 @@ describe "C-API Regexp function" do describe "rb_reg_new" do it "returns a new valid Regexp" do - my_re = @p.a_re + my_re = @p.a_re("a", 0) my_re.kind_of?(Regexp).should == true ('1a' =~ my_re).should == 1 ('1b' =~ my_re).should == nil my_re.source.should == 'a' end + + it "returns a Regexp with the given options" do + @p.a_re("a", 0).options == 0 + @p.a_re("a", Regexp::IGNORECASE).options.should == Regexp::IGNORECASE + @p.a_re("a", Regexp::EXTENDED).options.should == Regexp::EXTENDED + @p.a_re("a", Regexp::EXTENDED | Regexp::IGNORECASE).options.should == Regexp::EXTENDED | Regexp::IGNORECASE + @p.a_re("a", Regexp::MULTILINE).options.should == Regexp::MULTILINE + end end describe "rb_reg_nth_match" do |