Sha256: 0c32e0ce6f50d078696ca47cebc862d87a456fe5d2f01effb7b57414f78aaa3f

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

require "test_helper"
require "minitest/assert_dirs_equal"

module AssertDirsEqual
  class MinitestIntegrationTest < Minitest::Test
    def test_successful_assert
      @case_directory = "test/cases/empty_dirs_are_equal"
      assert_dirs_equal expected_dir, target_dir
    end

    def test_failed_assert
      @case_directory = "test/cases/missing_expected"

      error = assert_raises(Minitest::Assertion) do
        assert_dirs_equal expected_dir, target_dir
      end

      assert_equal "expected \"#{expected_dir}\" to exist", error.message
    end

    def test_successful_refute
      @case_directory = "test/cases/missing_expected"
      refute_dirs_equal expected_dir, target_dir
    end

    def test_failed_refute
      @case_directory = "test/cases/empty_dirs_are_equal"

      error = assert_raises(Minitest::Assertion) do
        refute_dirs_equal expected_dir, target_dir
      end

      assert_equal "expected \"#{target_dir}\" to not be equal to \"#{expected_dir}\", but they are equal", error.message
    end

    def test_minitest_powered_diff
      @case_directory = "test/cases/large_different_text_files"

      error = assert_raises(Minitest::Assertion) do
        assert_dirs_equal expected_dir, target_dir
      end

      assert_equal <<MSG, error.message
expected "#{target_dir}/file" to have same content as "#{expected_dir}/file":
--- expected
+++ actual
@@ -11,7 +11,7 @@
 minitest
 minitest
 minitest
-minitest
+rspec
 minitest
 minitest
 minitest
MSG
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assert_dirs_equal-0.1.0 test/minitest_integration_test.rb