1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00

Merge pull request #351 from route/fix-build

Fixed build
This commit is contained in:
Jon Leighton 2013-07-16 10:32:25 -07:00
commit af2841f4be
5 changed files with 10 additions and 16 deletions

View file

@ -1,6 +0,0 @@
#!/bin/bash
version=phantomjs-1.8.1-linux-i686
wget http://phantomjs.googlecode.com/files/$version.tar.bz2
tar xjf $version.tar.bz2
mv $version phantomjs

View file

@ -100,10 +100,6 @@ module Capybara::Poltergeist
end
it 'supports rendering the whole of a page that goes outside the viewport' do
if RUBY_VERSION >= "2.0.0"
pending "image_size seems to be incompatible with Ruby 2"
end
file = POLTERGEIST_ROOT + '/spec/tmp/screenshot.png'
@session.visit('/poltergeist/long_page')
@driver.save_screenshot(file)

View file

@ -74,7 +74,7 @@ describe Capybara::Session do
end
it "clicks properly" do
expect { @session.click_link "O hai" }.to_not raise_error(Capybara::Poltergeist::MouseEventFailed)
expect { @session.click_link "O hai" }.not_to raise_error
end
after do
@ -156,8 +156,11 @@ describe Capybara::Session do
end
it 'attaches a file when passed a Pathname' do
filename = Pathname.new('spec/tmp/a_test_pathname').expand_path
File.open(filename, 'w') { |f| f.write('text') }
element = @session.find(:css, '#change_me_file')
element.set Pathname.new("a_test_pathname")
element.set(filename)
element.value.should == 'C:\fakepath\a_test_pathname'
end
end

View file

@ -2,7 +2,7 @@ require 'spec_helper'
module Capybara::Poltergeist
describe Client do
let(:server) { stub(port: 6000) }
let(:server) { double(port: 6000) }
subject { Client.new(server) }
@ -15,7 +15,8 @@ module Capybara::Poltergeist
it "doesn't raise an error if phantomjs is too new" do
`true` # stubbing $?
subject.stub(:`).with('phantomjs --version').and_return("1.10.0 (development)\n")
expect { subject.start }.to_not raise_error(PhantomJSTooOld)
expect { subject.start }.not_to raise_error
subject.stop # process has been spawned, stopping
end
it 'shows the detected version in the version error message' do

View file

@ -52,7 +52,7 @@ module Capybara::Poltergeist
subject { Driver.new(nil, :timeout => 3) }
it 'starts the server with the provided timeout' do
server = stub
server = double
Server.should_receive(:new).with(anything, 3).and_return(server)
subject.server.should == server
end
@ -62,7 +62,7 @@ module Capybara::Poltergeist
subject { Driver.new(nil, :window_size => [800, 600]) }
it "creates a client with the desired width and height settings" do
server = stub
server = double
Server.should_receive(:new).and_return(server)
Client.should_receive(:start).with(server, hash_including(:window_size => [800, 600]))