Sha256: 512dc5b215c46f544ba150ba090ae2d9f3eca586e120ec998b8bb5513e61007a

Contents?: true

Size: 782 Bytes

Versions: 60

Compression:

Stored size: 782 Bytes

Contents

RSpec.describe Kernel do
  describe ".RE2" do
    it "returns an RE2::Regexp instance given a pattern" do
      expect(RE2('w(o)(o)')).to be_a(RE2::Regexp)
    end

    it "returns an RE2::Regexp instance given a pattern and options" do
      re = RE2('w(o)(o)', :case_sensitive => false)

      expect(re).not_to be_case_sensitive
    end

    it "raises an error if given an inappropriate type" do
      expect { RE2(nil) }.to raise_error(TypeError)
    end

    it "allows invalid patterns to be created" do
      re = RE2('???', :log_errors => false)

      expect(re).to be_a(RE2::Regexp)
    end

    it "supports passing something that can be coerced to a String as input" do
      re = RE2(StringLike.new('w(o)(o)'))

      expect(re).to be_a(RE2::Regexp)
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
re2-2.4.3 spec/kernel_spec.rb
re2-2.4.3-x86_64-linux spec/kernel_spec.rb
re2-2.4.3-x86_64-darwin spec/kernel_spec.rb
re2-2.4.3-x86-mingw32 spec/kernel_spec.rb
re2-2.4.3-x86-linux spec/kernel_spec.rb
re2-2.4.3-x64-mingw32 spec/kernel_spec.rb
re2-2.4.3-x64-mingw-ucrt spec/kernel_spec.rb
re2-2.4.3-arm64-darwin spec/kernel_spec.rb
re2-2.4.3-arm-linux spec/kernel_spec.rb
re2-2.4.3-aarch64-linux spec/kernel_spec.rb
re2-2.4.2 spec/kernel_spec.rb
re2-2.4.2-x86_64-linux spec/kernel_spec.rb
re2-2.4.2-x86_64-darwin spec/kernel_spec.rb
re2-2.4.2-x86-mingw32 spec/kernel_spec.rb
re2-2.4.2-x86-linux spec/kernel_spec.rb
re2-2.4.2-x64-mingw32 spec/kernel_spec.rb
re2-2.4.2-x64-mingw-ucrt spec/kernel_spec.rb
re2-2.4.2-arm64-darwin spec/kernel_spec.rb
re2-2.4.2-arm-linux spec/kernel_spec.rb
re2-2.4.2-aarch64-linux spec/kernel_spec.rb