Sha256: e5fe557ccc167a449783e3b1186bcf047119ec7dbaad7eceb8dc3c4e1dfbc47a

Contents?: true

Size: 503 Bytes

Versions: 4

Compression:

Stored size: 503 Bytes

Contents

require 'spec_helper'
module Domain
  describe SByC, "new" do

    it 'returns the value when it satisfies the predicate' do
      NegInt.new(-12).should eq(-12)
    end

    it 'raises a type error when the value does not satisfy the predicate' do
      lambda{
        NegInt.new(12)
      }.should raise_error(TypeError)
    end

    it 'raises a type error when the value is not a superclazz value' do
      lambda{
        NegInt.new("bla")
      }.should raise_error(TypeError)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
domain-1.0.0 spec/factory/sbyc_domain/test_new.rb
domain-1.0.0.rc4 spec/factory/sbyc_domain/test_new.rb
domain-1.0.0.rc3 spec/factory/sbyc_domain/test_new.rb
domain-1.0.0.rc2 spec/factory/sbyc_domain/test_new.rb