Module: Minitest::Assertions

Defined in:
lib/minitest/filesystem.rb

Instance Method Summary collapse

Instance Method Details

#assert_contains_filesystem(dir, msg = nil, &block) ⇒ Object



5
6
7
8
# File 'lib/minitest/filesystem.rb', line 5

def assert_contains_filesystem(dir, msg = nil, &block)
  matcher = Minitest::Filesystem::Matcher.new(dir, &block)
  assert matcher.match_found?, msg || matcher.message
end

#assert_exists(path, msg = nil, &block) ⇒ Object



10
11
12
# File 'lib/minitest/filesystem.rb', line 10

def assert_exists(path, msg = nil, &block)
  assert File.exists?(path), msg || "expected `#{path}` to exist, but it doesn't"
end

#filesystem(&block) ⇒ Object



18
19
20
# File 'lib/minitest/filesystem.rb', line 18

def filesystem(&block)
  block
end

#refute_exists(path, msg = nil, &block) ⇒ Object



14
15
16
# File 'lib/minitest/filesystem.rb', line 14

def refute_exists(path, msg = nil, &block)
  refute File.exists?(path), msg || "expected `#{path}` not to exist, but it does"
end