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-0.10.1 lib/serverspec/matchers/contain.rb
serverspec-0.10.0 lib/serverspec/matchers/contain.rb
serverspec-0.9.8 lib/serverspec/matchers/contain.rb
serverspec-0.9.7 lib/serverspec/matchers/contain.rb
serverspec-0.9.6 lib/serverspec/matchers/contain.rb
serverspec-0.9.5 lib/serverspec/matchers/contain.rb
serverspec-0.9.4 lib/serverspec/matchers/contain.rb
serverspec-0.9.3 lib/serverspec/matchers/contain.rb
serverspec-0.9.2 lib/serverspec/matchers/contain.rb
serverspec-0.9.1 lib/serverspec/matchers/contain.rb
serverspec-0.9.0 lib/serverspec/matchers/contain.rb
serverspec-0.8.1 lib/serverspec/matchers/contain.rb
serverspec-0.8.0 lib/serverspec/matchers/contain.rb
serverspec-0.7.13 lib/serverspec/matchers/contain.rb
serverspec-0.7.12 lib/serverspec/matchers/contain.rb
serverspec-0.7.11 lib/serverspec/matchers/contain.rb
serverspec-0.7.10 lib/serverspec/matchers/contain.rb
serverspec-0.7.9 lib/serverspec/matchers/contain.rb
serverspec-0.7.8 lib/serverspec/matchers/contain.rb
serverspec-0.7.7 lib/serverspec/matchers/contain.rb