Skip to content

Commit

Permalink
Merge pull request #92 from killphi/fix_run_on_changes
Browse files Browse the repository at this point in the history
fix vim file saving behavior
  • Loading branch information
thibaudgg committed Dec 2, 2013
2 parents 8e0f0a4 + e20657d commit 612d06a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/guard/livereload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/guard/livereload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 612d06a

Please sign in to comment.