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