2011-04-14 00:21:23 +00:00
|
|
|
require 'spec_helper'
|
2011-10-17 13:25:11 +00:00
|
|
|
require 'tempfile'
|
2011-04-14 00:21:23 +00:00
|
|
|
|
|
|
|
describe "jasmine-headless-webkit" do
|
2011-05-29 16:30:19 +00:00
|
|
|
let(:report) { 'spec/report.txt' }
|
|
|
|
|
|
|
|
before do
|
|
|
|
FileUtils.rm_f report
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
FileUtils.rm_f report
|
|
|
|
end
|
|
|
|
|
2011-08-22 17:26:48 +00:00
|
|
|
describe 'files' do
|
|
|
|
it 'should list all the files that will be found' do
|
|
|
|
files = %x{bin/jasmine-headless-webkit -l -j spec/jasmine/success/success.yml}
|
|
|
|
$?.exitstatus.should == 0
|
|
|
|
|
2011-10-17 13:25:11 +00:00
|
|
|
files.lines.to_a.should include(File.expand_path("./spec/jasmine/success/success.js\n"))
|
|
|
|
files.lines.to_a.should include(File.expand_path("./spec/jasmine/success/success_spec.js\n"))
|
2011-08-22 17:26:48 +00:00
|
|
|
end
|
|
|
|
end
|
2011-10-10 18:11:13 +00:00
|
|
|
|
|
|
|
describe 'runner-out' do
|
|
|
|
it 'should write out the runner HTML to the specified path and not run the test' do
|
|
|
|
runner_path = Tempfile.new('jhw')
|
|
|
|
runner_path.close
|
|
|
|
|
|
|
|
system %{bin/jasmine-headless-webkit -j spec/jasmine/success/success.yml --runner-out #{runner_path.path}}
|
|
|
|
|
|
|
|
File.size(runner_path.path).should_not == 0
|
|
|
|
end
|
|
|
|
end
|
2011-04-14 00:21:23 +00:00
|
|
|
end
|
|
|
|
|