Sha256: 46281c7505d2462432c515d2a79ede56bfe85004ba347c593a7febcb6c5121e6

Contents?: true

Size: 563 Bytes

Versions: 6

Compression:

Stored size: 563 Bytes

Contents

module DecimalMatcher
  class BeDecimal
    def initialize(expected)
      @expected = BigDecimal.new(expected)
    end

    def matches?(target)
      @target = target
      @target.is_a?(BigDecimal) && @target == @expected
    end

    def failure_message_for_should
      "expected #{@target.inspect} to be a [BigDecimal: #{@expected.to_s("F")}]"
    end

    def failure_message_for_should_not
      "expected #{@target.inspect} not to be a [BigDecimal: #{@expected.to_s("F")}]"
    end
  end

  def be_decimal(expected)
    BeDecimal.new(expected)
  end
end

Version data entries

6 entries across 1 versions & 1 rubygems

Version Path
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/decimal-money-5.1.1.patched/spec/support/decimal_matcher.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/decimal-money-5.1.1.patched/spec/support/decimal_matcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/decimal-money-5.1.1.patched/spec/support/decimal_matcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/decimal-money-5.1.1.patched/spec/support/decimal_matcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/decimal-money-5.1.1.patched/spec/support/decimal_matcher.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/decimal-money-5.1.1.patched/spec/support/decimal_matcher.rb