Skip to content

Commit

Permalink
Update phantom.js to 1.5.0
Browse files Browse the repository at this point in the history
As described in issue joshbuddy#21, changes were made to install phantom.js version 1.5 while bootstrapping. Tests pass.
  • Loading branch information
iStefo committed Apr 6, 2012
1 parent c158886 commit 867d325
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bin/setup-ghostbuster
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ when /darwin/
require 'fileutils'
root = File.expand_path(File.join(ENV['HOME'], '.ghostbuster'))
cache = File.expand_path(File.join(root, 'cache'))
unless File.exist?(File.join(root, 'version')) && File.read(File.join(root, 'version')) == '2'
unless File.exist?(File.join(root, 'version')) && File.read(File.join(root, 'version')) == '3'
puts "Creating ghostbuster directory in your home"
FileUtils.rm_rf(root)
FileUtils.mkdir_p(root)
FileUtils.mkdir_p(cache)
phantom_url = "http://phantomjs.googlecode.com/files/phantomjs-1.3.0-macosx-static-x86.zip"
phantom_url = "http://phantomjs.googlecode.com/files/phantomjs-1.5.0-macosx-static.zip"
unless File.exist?(File.join(cache, File.basename(phantom_url)))
Dir.chdir(cache) do
puts "Downloading and installing phantom.js"
system("curl #{phantom_url} -O") or raise("Unable to download from #{phantom_url}")
system("unzip #{File.basename(phantom_url)}") or raise("Unable to unzip archive")
end
File.exist?("#{cache}/phantomjs-1.3.0/bin/phantomjs") or raise("Unable to copy phantomjs from your disk image")
system("ln -s #{cache}/phantomjs-1.3.0/bin/phantomjs #{root}/phantomjs") or raise("Unable to copy phantomjs from your disk image")
File.exist?("#{cache}/phantomjs-1.5.0/bin/phantomjs") or raise("Unable to copy phantomjs from your disk image")
system("ln -s #{cache}/phantomjs-1.5.0/bin/phantomjs #{root}/phantomjs") or raise("Unable to copy phantomjs from your disk image")
File.open("#{root}/version", 'w') {|f| f << '2' }
puts "Done installing!"
end
Expand Down
4 changes: 2 additions & 2 deletions lib/ghostbuster.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class TestSuite
@failure += failure
@pending += pending
run: ->
if phantom.version.major == 1 and phantom.version.minor == 3
if phantom.version.major == 1 and phantom.version.minor == 5
@screenshots = @args[0] == 'true'
@screenshot_x = @args[1]
@screenshot_y = @args[2]
Expand Down Expand Up @@ -464,7 +464,7 @@ class TestSuite
console.log "Unable to load #{testFile}"
runNextTest()
else
console.log "Phantom version must be 1.3.x"
console.log "Phantom version must be 1.5.x"
phantom.exit 1

if phantom.args.length == 0
Expand Down

0 comments on commit 867d325

Please sign in to comment.