test/assertion_test.rb in minitest-filesystem-1.0.0 vs test/assertion_test.rb in minitest-filesystem-1.0.1
- old
+ new
@@ -52,59 +52,59 @@
it "fails when an expected file isn't found" do
l = lambda { assert_contains_filesystem(@root_dir) do
file "foo"
end }
- error = assert_raises(MiniTest::Assertion, &l)
+ error = assert_raises(Minitest::Assertion, &l)
error.message.must_match(/expected `#{@root_dir}` to contain file `foo`/im)
end
it "fails when an expected directory isn't found" do
l = lambda { assert_contains_filesystem(@root_dir) do
dir "bar"
end }
- error = assert_raises(MiniTest::Assertion, &l)
+ error = assert_raises(Minitest::Assertion, &l)
error.message.must_match(/expected `#{@root_dir}` to contain directory `bar`/im)
end
it "fails when an expected file within a subdirectory isn't found" do
l = lambda { assert_contains_filesystem(@root_dir) do
dir "a_subdirectory" do
file "missing_file"
end
end }
- error = assert_raises(MiniTest::Assertion, &l)
+ error = assert_raises(Minitest::Assertion, &l)
error.message.must_match(
/expected `#{@root_dir + 'a_subdirectory'}` to contain file `missing_file`/im)
end
it "fails when a directory is expected to be a file" do
l = lambda { assert_contains_filesystem(@root_dir) do
file "not_a_file"
end }
- error = assert_raises(MiniTest::Assertion, &l)
+ error = assert_raises(Minitest::Assertion, &l)
error.message.must_match(/expected `not_a_file` to be a file/im)
end
it "fails when a file is expected to be a directory" do
l = lambda { assert_contains_filesystem(@root_dir) do
dir "not_a_dir"
end }
- error = assert_raises(MiniTest::Assertion, &l)
+ error = assert_raises(Minitest::Assertion, &l)
error.message.must_match(/expected `not_a_dir` to be a directory/im)
end
it "allows to print custom error messages" do
failure_msg = "I really miss this file a lot"
l = lambda { assert_contains_filesystem(@root_dir, failure_msg) do
file "baz"
end }
- error = assert_raises(MiniTest::Assertion, &l)
+ error = assert_raises(Minitest::Assertion, &l)
error.message.must_equal(failure_msg)
end
end