make the rake task use the shiny new runner
This commit is contained in:
parent
96352d21a0
commit
293763cc1e
@ -27,7 +27,8 @@ module Jasmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initialize(opts = {})
|
def initialize(opts = {})
|
||||||
@options = DEFAULT_OPTIONS.dup.merge(opts)
|
@options = DEFAULT_OPTIONS.dup
|
||||||
|
opts.each { |k, v| @options[k] = v if v }
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_option(*args)
|
def process_option(*args)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
require 'jasmine/headless/runner'
|
||||||
|
|
||||||
module Jasmine
|
module Jasmine
|
||||||
module Headless
|
module Headless
|
||||||
class Task
|
class Task
|
||||||
@ -18,7 +20,11 @@ module Jasmine
|
|||||||
|
|
||||||
desc 'Run Jasmine specs headlessly'
|
desc 'Run Jasmine specs headlessly'
|
||||||
task name do
|
task name do
|
||||||
system %{jasmine-headless-webkit #{@colors ? "-c" : "--no-colors"} #{@keep_on_error ? "--keep" : ""} #{@jasmine_config ? "-j #{@jasmine_config}" : ""}}
|
Jasmine::Headless::Runner.run(
|
||||||
|
:colors => colors,
|
||||||
|
:remove_html_file => !@keep_on_error,
|
||||||
|
:jasmine_config => @jasmine_config
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -7,9 +7,11 @@ describe Jasmine::Headless::Options do
|
|||||||
let(:opts) { {} }
|
let(:opts) { {} }
|
||||||
|
|
||||||
describe '#initialize' do
|
describe '#initialize' do
|
||||||
|
let(:default_config) { 'spec/javascripts/support/jasmine.yml' }
|
||||||
|
|
||||||
context 'empty' do
|
context 'empty' do
|
||||||
it "should have default options" do
|
it "should have default options" do
|
||||||
options[:jasmine_config].should == 'spec/javascripts/support/jasmine.yml'
|
options[:jasmine_config].should == default_config
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -20,6 +22,14 @@ describe Jasmine::Headless::Options do
|
|||||||
options[:jasmine_config].should == 'test'
|
options[:jasmine_config].should == 'test'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with nil provided' do
|
||||||
|
let(:opts) { { :jasmine_config => nil } }
|
||||||
|
|
||||||
|
it 'should override an option' do
|
||||||
|
options[:jasmine_config].should == default_config
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#process_option' do
|
describe '#process_option' do
|
||||||
|
@ -7,7 +7,7 @@ describe Jasmine::Headless::Runner do
|
|||||||
let(:options) { Jasmine::Headless::Options.new(opts) }
|
let(:options) { Jasmine::Headless::Options.new(opts) }
|
||||||
|
|
||||||
describe '#initialize' do
|
describe '#initialize' do
|
||||||
let(:opts) { { :test => 'test' } }
|
let(:opts) { { :test => 'test', :jasmine_config => nil } }
|
||||||
|
|
||||||
it 'should have default options' do
|
it 'should have default options' do
|
||||||
runner.options[:test].should == 'test'
|
runner.options[:test].should == 'test'
|
||||||
|
Loading…
Reference in New Issue
Block a user