Sha256: 5e26455eccaae86bef5031fd2cc07da9140cfb6bf267a4ca47ff6f3ce8d81a22

Contents?: true

Size: 707 Bytes

Versions: 3

Compression:

Stored size: 707 Bytes

Contents

require "spec_helper"
require "ruby_ext/should"

describe 'Assert' do
  it 'should! & should_not!' do
    lambda{should! :be_never_called}.should raise_error(/ever/)
    lambda{nil.should_not! :be_nil}.should raise_error(/nil/)
    1.should_not! :be_nil
    1.should! :==, 1
    lambda{1.should! :==, 2}.should raise_error(%r{==})
    1.should! :be_in, [1, 2]
    "".should! :be_a, String
    String.should! :be, String      
    1.should! :<, 2
  end    
  
  it 'should_be! & should_not_be!' do
    [].should_be! :empty
    [''].should_not_be! :empty
    
    lambda{[''].should_be! :empty}.should raise_error(/should be/)
    lambda{[].should_not_be! :empty}.should raise_error(/should not be/)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_ext-0.4.11 spec/should_spec.rb
ruby_ext-0.4.10 spec/should_spec.rb
ruby_ext-0.4.9 spec/should_spec.rb