spec/spec_helper.rb in blather-0.4.15 vs spec/spec_helper.rb in blather-0.4.16
- old
+ new
@@ -1,11 +1,8 @@
-$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..'))
-$:.unshift File.expand_path(File.join(File.dirname(__FILE__), *%w[.. lib]))
+$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require 'blather'
-require 'rubygems'
-gem 'minitest', '>=1.7.1'
require 'minitest/spec'
require 'mocha'
require 'mocha/expectation_error'
MiniTest::Unit.autorun
@@ -20,25 +17,21 @@
m << " by #{mu_pp args[:by]}" if args[:by]
m << (args[:from] ? " from #{mu_pp args[:from]}" : '') + " to #{mu_pp args[:to]}" if args[:to]
m
}.call
- init_val = eval(stmt)
+ init_val = eval stmt
yield
- new_val = eval(stmt)
+ new_val = eval stmt
assert_equal(args[:by], (new_val - init_val), msg) if args[:by]
assert_equal([args[:from], args[:to]], [(init_val if args[:from]), new_val], msg) if args[:to]
refute_equal(init_val, new_val, msg) if args.empty?
end
-
+
def assert_nothing_raised(*args)
self._assertions += 1
- if Module === args.last
- msg = nil
- else
- msg = args.pop
- end
+ msg = Module === args.last ? nil : args.pop
begin
line = __LINE__; yield
rescue Exception => e
bt = e.backtrace
as = e.instance_of?(MiniTest::Assertion)