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.42 spec/custom_matchers_spec.rb
Active-0.0.41 spec/custom_matchers_spec.rb
Active-0.0.40 spec/custom_matchers_spec.rb
Active-0.0.39 spec/custom_matchers_spec.rb
Active-0.0.38 spec/custom_matchers_spec.rb
Active-0.0.37 spec/custom_matchers_spec.rb
Active-0.0.36 spec/custom_matchers_spec.rb
Active-0.0.35 spec/custom_matchers_spec.rb
Active-0.0.34 spec/custom_matchers_spec.rb
Active-0.0.32 spec/custom_matchers_spec.rb
Active-0.0.31 spec/custom_matchers_spec.rb
Active-0.0.30 spec/custom_matchers_spec.rb
Active-0.0.29 spec/custom_matchers_spec.rb
Active-0.0.28 spec/custom_matchers_spec.rb
Active-0.0.27 spec/custom_matchers_spec.rb
Active-0.0.26 spec/custom_matchers_spec.rb
Active-0.0.25 spec/custom_matchers_spec.rb
Active-0.0.24 spec/custom_matchers_spec.rb
Active-0.0.23 spec/custom_matchers_spec.rb
Active-0.0.22 spec/custom_matchers_spec.rb