Sha256: 49bed965cae9194ef2a2d5481e72c885905d92ad9bd3f27cfdae388ffd76c7c5

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class TestExpectationBuilder < Matchy.test_case_class
  
  def setup
    @obj = Object.new
  end
  
  def test_should
    exp = Matchy::ExpectationBuilder.build_expectation(true, nil, @obj)
    exp.send(:==, @obj)
  end
  
  def test_should_fails
    expect_1 = Matchy::ExpectationBuilder.build_expectation(true, nil, 1)
    lambda {expect_1.send(:==, 2)}.should raise_error
  end
  
  def test_should_not
    exp = Matchy::ExpectationBuilder.build_expectation(false, nil, @obj)
    exp.send(:==, 1)
  end
  
  def test_should_not_fails
    expect_not_1 = Matchy::ExpectationBuilder.build_expectation(false, nil, 1)
    lambda {expect_not_1.send(:==, 1)}.should raise_error
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mcmire-matchy-0.5.2 test/test_expectation_builder.rb
mcmire-matchy-0.5.1 test/test_expectation_builder.rb
mcmire-matchy-0.5.0 test/test_expectation_builder.rb