test/unit/utils_tests.rb in assert-2.17.0 vs test/unit/utils_tests.rb in assert-2.18.0
- old
+ new
@@ -3,11 +3,10 @@
require "tempfile"
require "assert/config"
module Assert::Utils
-
class UnitTests < Assert::Context
desc "Assert::Utils"
subject{ Assert::Utils }
setup do
@objs = [1, "hi there", Hash.new, [:a, :b]]
@@ -15,11 +14,10 @@
should have_imeths :show, :show_for_diff
should have_imeths :tempfile
should have_imeths :stdlib_pp_proc, :default_use_diff_proc, :syscmd_diff_proc
should have_imeths :git_changed_proc
-
end
class ShowTests < UnitTests
desc "`show`"
setup do
@@ -38,11 +36,10 @@
should "use `pp_proc` to show objs when `pp_objects` setting is true" do
@objs.each do |obj|
assert_equal @pp_config.pp_proc.call(obj), subject.show(obj, @pp_config)
end
end
-
end
class ShowForDiffTests < ShowTests
desc "`show_for_diff`"
setup do
@@ -57,11 +54,10 @@
should "make any obj ids generic" do
exp_out = "#<#<Class:0xXXXXXX>:0xXXXXXX>"
assert_equal exp_out, subject.show_for_diff(@w_obj_id, Factory.modes_off_config)
end
-
end
class TempfileTests < UnitTests
desc "`tempfile`"
@@ -73,11 +69,10 @@
tmpfile.pos = 0
assert_equal "some-content\n", tmpfile.read
end
end
-
end
class StdlibPpProcTests < UnitTests
desc "`stdlib_pp_proc`"
@@ -89,11 +84,10 @@
cust_width = 1
exp_obj_pps = @objs.map{ |o| PP.pp(o, "", cust_width).strip }
act_obj_pps = @objs.map{ |o| subject.stdlib_pp_proc(cust_width).call(o) }
assert_equal exp_obj_pps, act_obj_pps
end
-
end
class DefaultUseDiffProcTests < UnitTests
desc "`default_use_diff_proc`"
setup do
@@ -109,11 +103,10 @@
assert proc.call(@newlines, "")
assert proc.call("", @longer)
assert proc.call("", @newlines)
assert proc.call(@longer, @newlines)
end
-
end
class SyscmdDiffProc < UnitTests
desc "`syscmd_diff_proc`"
setup do
@@ -140,9 +133,7 @@
out.sub!(/^\+\+\+ .+/, "+++ actual")
end
assert_equal exp_diff_out, subject.syscmd_diff_proc(cust_syscmd).call(@diff_a, @diff_b)
end
-
end
-
end