Sha256: 9bdc4eca96408c50c756ad24bee80710477afd71f3d5a9860e421b1466cd1cbb

Contents?: true

Size: 494 Bytes

Versions: 97

Compression:

Stored size: 494 Bytes

Contents

RSpec::Matchers.define :contain do |pattern|
  match do |file|
    file.contain(pattern, @from, @to)
  end
  # for contain(pattern).from(/A/).to(/B/)
  chain :from do |from|
    @from = Regexp.new(from).inspect
  end
  chain :to do |to|
    @to = Regexp.new(to).inspect
  end
  # for contain(pattern).after(/A/)
  chain :after do |after|
    @from = Regexp.new(after).inspect
  end
  # for contain(pattern).before(/B/)
  chain :before do |before|
    @to = Regexp.new(before).inspect
  end
end

Version data entries

97 entries across 97 versions & 1 rubygems

Version Path
serverspec-1.0.0 lib/serverspec/matchers/contain.rb
serverspec-0.16.0 lib/serverspec/matchers/contain.rb
serverspec-0.15.5 lib/serverspec/matchers/contain.rb
serverspec-0.15.4 lib/serverspec/matchers/contain.rb
serverspec-0.15.3 lib/serverspec/matchers/contain.rb
serverspec-0.15.2 lib/serverspec/matchers/contain.rb
serverspec-0.15.1 lib/serverspec/matchers/contain.rb
serverspec-0.15.0 lib/serverspec/matchers/contain.rb
serverspec-0.14.4 lib/serverspec/matchers/contain.rb
serverspec-0.14.3 lib/serverspec/matchers/contain.rb
serverspec-0.14.2 lib/serverspec/matchers/contain.rb
serverspec-0.14.1 lib/serverspec/matchers/contain.rb
serverspec-0.14.0 lib/serverspec/matchers/contain.rb
serverspec-0.13.7 lib/serverspec/matchers/contain.rb
serverspec-0.13.6 lib/serverspec/matchers/contain.rb
serverspec-0.13.5 lib/serverspec/matchers/contain.rb
serverspec-0.13.4 lib/serverspec/matchers/contain.rb
serverspec-0.13.3 lib/serverspec/matchers/contain.rb
serverspec-0.13.2 lib/serverspec/matchers/contain.rb
serverspec-0.13.1 lib/serverspec/matchers/contain.rb