Sha256: 0cda7b3082202b66a567468c705381a72d99bf879f6a77e553404c5a4da47e16

Contents?: true

Size: 558 Bytes

Versions: 37

Compression:

Stored size: 558 Bytes

Contents

class BeEqualTo
  def initialize(expectation)
    @expectation = expectation
  end
  
  def matches?(instance)
    @instance = instance
    return @instance == @expectation
  end
  
  def description
    "be equal to #{@expectation}"
  end
  
  def failure_message
    " expected to be equal to #{@expectation}, but was not, and had the following errors:\n #{@instance}"
  end
  
  def negative_failure_message
    " expected to not be valid, but was. (Are you missing a validation?)"
  end
end

def be_equal_to(expectation)
  BeEqualTo.new(expectation)
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
vj-sdk-0.6.5 spec/helpers/be_equal_to.rb
vj-sdk-0.6.4 spec/helpers/be_equal_to.rb
vj-sdk-0.6.3 spec/helpers/be_equal_to.rb
vj-sdk-0.6.1 spec/helpers/be_equal_to.rb
vj-sdk-0.6.0 spec/helpers/be_equal_to.rb
vj-sdk-0.5.6 spec/helpers/be_equal_to.rb
vj-sdk-0.5.5 spec/helpers/be_equal_to.rb
vj-sdk-0.5.4 spec/helpers/be_equal_to.rb
vj-sdk-0.5.3 spec/helpers/be_equal_to.rb
vj-sdk-0.5.2 spec/helpers/be_equal_to.rb
vj-sdk-0.5.1 spec/helpers/be_equal_to.rb
vj-sdk-0.5.0 spec/helpers/be_equal_to.rb
vj-sdk-0.4.3 spec/helpers/be_equal_to.rb
vj-sdk-0.4.2 spec/helpers/be_equal_to.rb
vj-sdk-0.4.1 spec/helpers/be_equal_to.rb
vj-sdk-0.4.0 spec/helpers/be_equal_to.rb
vj-sdk-0.2.1 spec/helpers/be_equal_to.rb