fix running from non-cli
This commit is contained in:
parent
cdff35c0e2
commit
50bd14a82e
lib/jasmine/headless
spec
@ -24,7 +24,10 @@ module Jasmine
|
||||
|
||||
RUNNER = File.expand_path('../../../../ext/jasmine-webkit-specrunner/jasmine-webkit-specrunner', __FILE__)
|
||||
|
||||
def self.run(options = DEFAULT_OPTIONS.dup)
|
||||
attr_reader :options
|
||||
|
||||
def self.run(options = {})
|
||||
options = Options.new(options) if !options.kind_of?(Options)
|
||||
new(options).run
|
||||
end
|
||||
|
||||
@ -60,6 +63,7 @@ module Jasmine
|
||||
system jasmine_command(run_targets)
|
||||
status = $?.exitstatus
|
||||
|
||||
p @options
|
||||
if @options[:remove_html_file] || (status == 0)
|
||||
targets.each { |target| FileUtils.rm_f target }
|
||||
end
|
||||
|
@ -23,6 +23,7 @@ describe "jasmine-headless-webkit" do
|
||||
|
||||
describe 'success but with js error' do
|
||||
it "should succeed with error code 0" do
|
||||
p "here"
|
||||
system %{bin/jasmine-headless-webkit -j spec/jasmine/success_with_error/success_with_error.yml --report #{report}}
|
||||
$?.exitstatus.should == 1
|
||||
|
||||
|
@ -6,6 +6,15 @@ describe Jasmine::Headless::Runner do
|
||||
let(:runner) { Jasmine::Headless::Runner.new(options) }
|
||||
let(:options) { Jasmine::Headless::Options.new(opts) }
|
||||
|
||||
describe '#initialize' do
|
||||
let(:opts) { { :test => 'test' } }
|
||||
|
||||
it 'should have default options' do
|
||||
runner.options[:test].should == 'test'
|
||||
runner.options[:jasmine_config].should == 'spec/javascripts/support/jasmine.yml'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#load_config' do
|
||||
include FakeFS::SpecHelpers
|
||||
|
||||
|
@ -20,3 +20,4 @@ RSpec::Matchers.define :be_a_report_containing do |total, fails, used_console|
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user