test/cli/commands/test_watch.rb in nanoc-3.7.4 vs test/cli/commands/test_watch.rb in nanoc-3.7.5
- old
+ new
@@ -1,11 +1,10 @@
# encoding: utf-8
class Nanoc::CLI::Commands::WatchTest < Nanoc::TestCase
-
def test_run
- with_site do |s|
+ with_site do |_s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
@@ -17,11 +16,11 @@
watch_thread.kill
end
end
def test_notify
- with_site do |s|
+ with_site do |_s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
@@ -48,11 +47,11 @@
20.times do
break if File.file?(filename)
sleep 0.5
end
unless File.file?(filename)
- raise RuntimeError, "Expected #{filename} to appear but it didn't :("
+ raise "Expected #{filename} to appear but it didn't :("
end
end
def wait_until_content_equals(filename, expected_content)
wait_until_exists(filename)
@@ -62,15 +61,14 @@
sleep 0.5
end
actual_content = File.read(filename)
if actual_content != expected_content
- raise RuntimeError, "Expected #{filename} to have " \
+ raise "Expected #{filename} to have " \
"content #{expected_content.inspect} but it had " \
"content #{actual_content.inspect} instead :("
end
# Ugly, but seems to be necessary or changes are not picked up. :(
sleep 0.5
end
-
end