Sha256: 0a8e75df0af7111ca728a54fb191fad77365d961b2b46dbefab63100b1f953ce

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

describe "Matcher::Match" do
  it 'match passes when subject is a string and matches the regex' do
    expect("asd asd asd").to match(/asd/)
  end

  it "match fails when subject is a string and doesn't match the regex" do
    expect_failure{ expect("qwerty qwerty").to match(/asd/) }
  end

  it "match passes when subject is a regex and matches the given string" do
    expect(/foo/).to match("food")
  end

  it "match fails when subject is a regex and doesn't matche the given string" do
    expect_failure{ expect(/foo/).to match("drink") }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bacon-expect-1.0.2 spec_app/spec/matchers/match_spec.rb
bacon-expect-1.0.1 spec_app/spec/matchers/match_spec.rb
bacon-expect-0.1 spec_app/spec/matchers/match_spec.rb