Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix vim file saving behavior #92

Merged
merged 1 commit into from
Dec 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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