Class: Minitest::Test
- Inherits:
-
Object
- Object
- Minitest::Test
- Defined in:
- lib/minitest/assert_dirs_equal.rb
Instance Method Summary collapse
-
#assert_dir_included(expected, target) ⇒ Object
Fails if
targetlacks some files, or any file in the directory differs from according content inexpected. -
#assert_dirs_equal(expected, target) ⇒ Object
Fails if
targetlacks some files, or has extra files, or any file in the directory differs from according content inexpected. -
#refute_dir_included(expected, target) ⇒ Object
Fails if
targetincludes the same files fromexpected. -
#refute_dirs_equal(expected, target) ⇒ Object
Fails if
targethas exactly the same file tree structure and content.
Instance Method Details
#assert_dir_included(expected, target) ⇒ Object
Extra files in target are ignored.
Fails if target lacks some files, or any file in the directory differs from according content in expected. Should be read as ‘Content from expected is expected to be “included” in target’.
44 45 46 47 |
# File 'lib/minitest/assert_dirs_equal.rb', line 44 def assert_dir_included(expected, target) matcher = AssertDirsEqual::Matcher.new(expected, exact_match: false) assert matcher.matches?(target), matcher. end |
#assert_dirs_equal(expected, target) ⇒ Object
Fails if target lacks some files, or has extra files, or any file in the directory differs from according content in expected.
22 23 24 25 |
# File 'lib/minitest/assert_dirs_equal.rb', line 22 def assert_dirs_equal(expected, target) matcher = AssertDirsEqual::Matcher.new(expected) assert matcher.matches?(target), matcher. end |
#refute_dir_included(expected, target) ⇒ Object
Extra files in target are ignored.
Fails if target includes the same files from expected.
54 55 56 57 |
# File 'lib/minitest/assert_dirs_equal.rb', line 54 def refute_dir_included(expected, target) matcher = AssertDirsEqual::Matcher.new(expected, exact_match: false) refute matcher.matches?(target), matcher. end |
#refute_dirs_equal(expected, target) ⇒ Object
Fails if target has exactly the same file tree structure and content.
32 33 34 35 |
# File 'lib/minitest/assert_dirs_equal.rb', line 32 def refute_dirs_equal(expected, target) matcher = AssertDirsEqual::Matcher.new(expected) refute matcher.matches?(target), matcher. end |