Sha256: 13179ad431d7de9b7fdbda29893f9c7cb2f180a83a01b84de574a907475985be

Contents?: true

Size: 520 Bytes

Versions: 9

Compression:

Stored size: 520 Bytes

Contents

require 'nagios_check'

module Matchers
  class Contain
    def initialize(expected)
      @expected = expected
    end

    def matches?(actual)
      @actual = actual
      @actual.include? @expected
    end

    def failure_message
      "expected #{@actual} to contain #{@expected}" 
    end

    def negative_failure_message
      "expected #{@actual} not to contain #{@expected}"
    end
  end

  def contain(value)
    Contain::new(value)
  end
end

RSpec.configure do |config|  
  config.include(Matchers)  
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
nagios_check-0.2.0 spec/spec_helper.rb
nagios_check-0.1.1 spec/spec_helper.rb
nagios_check-0.1.0 spec/spec_helper.rb
nagios_check-0.0.6 spec/spec_helper.rb
nagios_check-0.0.5 spec/spec_helper.rb
nagios_check-0.0.4 spec/spec_helper.rb
nagios_check-0.0.3 spec/spec_helper.rb
nagios_check-0.0.2 spec/spec_helper.rb
nagios_check-0.0.1 spec/spec_helper.rb