spec/platform_spec.rb in phantomjs-1.9.2.0 vs spec/platform_spec.rb in phantomjs-1.9.2.1

- old
+ new

@@ -55,10 +55,14 @@ end it "reports the Darwin platform as unuseable" do Phantomjs::Platform::OsX.should_not be_useable end + + it "reports the Win32 Platform as unuseable" do + Phantomjs::Platform::Win32.should_not be_useable + end end describe "on a 32 bit linux" do before do Phantomjs::Platform.stub(:host_os).and_return('linux-gnu') @@ -99,10 +103,14 @@ end it "reports the Darwin platform as unuseable" do Phantomjs::Platform::OsX.should_not be_useable end + + it "reports the Win32 Platform as unuseable" do + Phantomjs::Platform::Win32.should_not be_useable + end end describe "on OS X" do before do Phantomjs::Platform.stub(:host_os).and_return('darwin') @@ -128,9 +136,51 @@ end it "returns the correct phantom js executable path for the platform" do expect(Phantomjs.path).to be == '/tmp/path' end + end + + it "reports the Linux32 Platform as unuseable" do + Phantomjs::Platform::Linux32.should_not be_useable + end + + it "reports the Linux64 platform as unuseable" do + Phantomjs::Platform::Linux64.should_not be_useable + end + + it "reports the Win32 Platform as unuseable" do + Phantomjs::Platform::Win32.should_not be_useable + end + end + + describe "on Windows" do + before do + Phantomjs::Platform.stub(:host_os).and_return('mingw32') + Phantomjs::Platform.stub(:architecture).and_return('i686') + end + + describe "without system install" do + before(:each) { Phantomjs::Platform.stub(:system_phantomjs_version).and_return(nil) } + + it "returns the correct phantom js executable path for the platform" do + Phantomjs.path.should =~ /win32\/phantomjs.exe$/ + end + end + + describe "with system install" do + before(:each) do + Phantomjs::Platform.stub(:system_phantomjs_version).and_return(Phantomjs.version) + Phantomjs::Platform.stub(:system_phantomjs_path).and_return("#{ENV['TEMP']}/path") + end + + it "returns the correct phantom js executable path for the platform" do + expect(Phantomjs.path).to be == "#{ENV['TEMP']}/path" + end + end + + it "reports the Darwin platform as unuseable" do + Phantomjs::Platform::OsX.should_not be_useable end it "reports the Linux32 Platform as unuseable" do Phantomjs::Platform::Linux32.should_not be_useable end