Sha256: 22dbf348371743747c7d499b13fc5cff28a473ff2aaac71dc491737fd0b0ea30

Contents?: true

Size: 873 Bytes

Versions: 7

Compression:

Stored size: 873 Bytes

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'pokerstats'
require 'spec'
require 'spec/autorun'

Spec::Runner.configure do |config|
  
end

Spec::Matchers.define :be_hash_similar_with do |expected|
  match do |actual|
      @errors = []
      for key in (expected.keys + actual.keys).uniq
          @errors << {:expected => expected[key], :actual => actual[key], :key => key} unless expected[key] == actual[key]
      end
      @errors.empty?
  end
  failure_message_for_should do |hash|
    @errors.collect{|each| "expected #{each[:key].inspect} to be #{each[:expected].inspect}, but got #{each[:actual].inspect}"}.join(";\n")
  end
  failure_message_for_should_not do |hash|
    "the two elements are hash_similar"
  end
  description do
    "have the same values for corresponding keys"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pokerstats-2.3.0 spec/spec_helper.rb
pokerstats-2.2.0 spec/spec_helper.rb
pokerstats-2.1.0 spec/spec_helper.rb
pokerstats-2.0.19 spec/spec_helper.rb
pokerstats-2.0.18 spec/spec_helper.rb
pokerstats-2.0.17 spec/spec_helper.rb
pokerstats-2.0.16 spec/spec_helper.rb