require "#{File.dirname __FILE__}/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