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
videojuicer-vj-sdk-0.1.12 spec/helpers/be_equal_to.rb
vj-sdk-0.8.2 spec/helpers/be_equal_to.rb
vj-sdk-0.8.0.1 spec/helpers/be_equal_to.rb
vj-sdk-0.7.14 spec/helpers/be_equal_to.rb
vj-sdk-0.7.13 spec/helpers/be_equal_to.rb
vj-sdk-0.7.11 spec/helpers/be_equal_to.rb
vj-sdk-0.7.10 spec/helpers/be_equal_to.rb
vj-sdk-0.7.9 spec/helpers/be_equal_to.rb
vj-sdk-0.7.8 spec/helpers/be_equal_to.rb
vj-sdk-0.7.7 spec/helpers/be_equal_to.rb
vj-sdk-0.7.6 spec/helpers/be_equal_to.rb
vj-sdk-0.7.5 spec/helpers/be_equal_to.rb
vj-sdk-0.7.4 spec/helpers/be_equal_to.rb
vj-sdk-0.7.3 spec/helpers/be_equal_to.rb
vj-sdk-0.7.2 spec/helpers/be_equal_to.rb
vj-sdk-0.7.1 spec/helpers/be_equal_to.rb
vj-sdk-0.7.0 spec/helpers/be_equal_to.rb
vj-sdk-0.6.9 spec/helpers/be_equal_to.rb
vj-sdk-0.6.8 spec/helpers/be_equal_to.rb
vj-sdk-0.6.7 spec/helpers/be_equal_to.rb