Sha256: abdd803bbf9123d845ad5122e7bd584ee07fb16d175b90483f5c92ce930bc124

Contents?: true

Size: 611 Bytes

Versions: 29

Compression:

Stored size: 611 Bytes

Contents

module CustomMatchers
  
  class Param
    def initialize(expected)
      @expected = expected
    end

    def matches?(actual)
      @actual = actual
      # Satisfy expectation here. Return false or raise an error if it's not met.
      @actual.include?(@expected)
    end

    def failure_message_for_should
      "expected #{@actual.inspect} to have param #{@expected.inspect}, but it didn't"
    end

    def failure_message_for_should_not
      "expected #{@actual.inspect} not to have param #{@expected.inspect}, but it did"
    end
  end

  def have_param(expected)
    Param.new(expected)
  end
  
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
Active-0.0.21 spec/custom_matchers_spec.rb
Active-0.0.18 spec/custom_matchers_spec.rb
Active-0.0.17 spec/custom_matchers_spec.rb
Active-0.0.14 spec/custom_matchers_spec.rb
Active-0.0.12 spec/custom_matchers_spec.rb
Active-0.0.11 spec/custom_matchers_spec.rb
Active-0.0.9 spec/custom_matchers_spec.rb
Active-0.0.8 spec/custom_matchers_spec.rb
Active-0.0.7 spec/custom_matchers_spec.rb