Sha256: 9de8f84b8dbcee4b1128be6265fdcb743f84c5d4d7c2e3be18992f3dd0509825

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 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 an argument error when the value does not satisfy the predicate' do
      lambda{
        NegInt.new(12)
      }.should raise_error(ArgumentError)
    end

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

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
domain-1.0.0.rc1 spec/factory/sbyc_domain/test_new.rb