Browse files

fix vim file saving behavior

only run when changed file has modifications
  • Loading branch information...
1 parent 8e0f0a4 commit e20657df1d2f6c05b9ddb5a98177f8fc8c1cdfbe @killphi killphi committed Dec 1, 2013
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/guard/livereload.rb
  2. +3 −3 spec/lib/guard/livereload_spec.rb
View
2 lib/guard/livereload.rb
@@ -27,7 +27,7 @@ def stop
reactor.stop
end
- def run_on_changes(paths)
+ def run_on_modifications(paths)
sleep options[:grace_period]
reactor.reload_browser(paths)
end
View
6 spec/lib/guard/livereload_spec.rb
@@ -100,17 +100,17 @@
end
end
- describe "#run_on_changes" do
+ describe "#run_on_modifications" do
it "reloads browser" do
expect(reactor).to receive(:reload_browser).with(['foo'])
- plugin.run_on_changes(['foo'])
+ plugin.run_on_modifications(['foo'])
end
it "can wait 0.5 seconds before reloading the browser" do
expect(reactor).to receive(:reload_browser).with(['foo'])
expect(plugin).to receive(:sleep).with(0.5)
plugin.options[:grace_period] = 0.5
- plugin.run_on_changes(['foo'])
+ plugin.run_on_modifications(['foo'])
end
end
end

0 comments on commit e20657d

Please sign in to comment.