Skip to content
Browse files

Specs are green

  • Loading branch information...
1 parent 24ea8a1 commit 28822b375d6adff80038e11f42819809282f972b @route route committed Nov 23, 2013
Showing with 15 additions and 6 deletions.
  1. +15 −6 spec/unit/client_spec.rb
View
21 spec/unit/client_spec.rb
@@ -8,21 +8,30 @@ module Capybara::Poltergeist
context '#initialize' do
it 'raises an error if phantomjs is too old' do
- Cliver::Detector.any_instance.
- stub(:`).with(/phantomjs --version/).and_return("1.3.0\n")
+ Cliver::ShellCapture.any_instance.stub(
+ :stdout => "1.3.0\n",
+ :command_found => true
+ )
+
expect { subject }.to raise_error(Cliver::Dependency::VersionMismatch)
end
it "doesn't raise an error if phantomjs is too new" do
- Cliver::Detector.any_instance.
- stub(:`).with(/phantomjs --version/).and_return("1.10.0 (development)\n")
+ Cliver::ShellCapture.any_instance.stub(
+ :stdout => "1.10.0 (development)\n",
+ :command_found => true
+ )
+
expect { subject }.to_not raise_error
subject.stop # process has been spawned, stopping
end
it 'shows the detected version in the version error message' do
- Cliver::Detector.any_instance.
- stub(:`).with(/phantomjs --version/).and_return("1.3.0\n")
+ Cliver::ShellCapture.any_instance.stub(
+ :stdout => "1.3.0\n",
+ :command_found => true
+ )
+
expect { subject }.to raise_error(Cliver::Dependency::VersionMismatch) do |e|
expect(e.message).to include('1.3.0')
end

0 comments on commit 28822b3

Please sign in to comment.
Something went wrong with that request. Please try again.