Sha256: 124f79451dbf6e064deebddd2b8a797ad7a371ac7876a6dea34cddba0eb1d2f6

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

require "#{File.dirname __FILE__}/../ruby_ext_spec_helper"
require "ruby_ext/must"

describe 'Assert' do
  it 'must & must_not' do
      lambda{must_be.never_called}.should raise_error(/ever/)
      lambda{nil.must_not_be.nil}.should raise_error(/nil/)
      1.must_not_be.nil
      1.must_be.== 1
      lambda{1.must_be.== 2}.should raise_error(%r{==})
      1.must_be.in 1, 2
      "".must_be.a String
      1.must_be.< 2
  end   
  
  it 'must_be & must_not_be' do
    [].must_be.empty    
    [''].must_not_be.empty
    
    lambda{[''].must_be.empty}.should raise_error(/must be/)
    lambda{[].must_not_be.empty}.should raise_error(/must not be/)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-ext-0.4.1 spec/ruby_ext/must_spec.rb
ruby-ext-0.4.0 spec/ruby_ext/must_spec.rb