also allow runner output to be defined in yaml, implements #66
This commit is contained in:
parent
0be7b9e20c
commit
951cf80f09
@ -82,7 +82,13 @@ module Jasmine
|
||||
end
|
||||
|
||||
def runner_filename
|
||||
options[:runner_output_filename]
|
||||
options[:runner_output_filename] || begin
|
||||
if (runner_output = jasmine_config['runner_output']) && !runner_output.empty?
|
||||
runner_output
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -103,21 +103,56 @@ describe Jasmine::Headless::Runner do
|
||||
end
|
||||
|
||||
describe '#runner_filename' do
|
||||
context 'not provided' do
|
||||
let(:runner_filename) { runner.runner_filename }
|
||||
let(:yaml_output) { 'yaml output' }
|
||||
|
||||
context 'not in options' do
|
||||
let(:opts) { { :runner_output_filename => false } }
|
||||
|
||||
context 'not in yaml file' do
|
||||
before do
|
||||
runner.stubs(:jasmine_config).returns('runner_output' => '')
|
||||
end
|
||||
|
||||
it 'should reverse the remove_html_file option' do
|
||||
runner.runner_filename.should == false
|
||||
runner_filename.should == false
|
||||
end
|
||||
end
|
||||
|
||||
context 'provided' do
|
||||
context 'in yaml file' do
|
||||
before do
|
||||
runner.stubs(:jasmine_config).returns('runner_output' => yaml_output)
|
||||
end
|
||||
|
||||
it 'should use the yaml file definition' do
|
||||
runner_filename.should == yaml_output
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'in options' do
|
||||
let(:filename) { 'filename.html' }
|
||||
let(:opts) { { :runner_output_filename => filename } }
|
||||
|
||||
context 'not in yaml file' do
|
||||
before do
|
||||
runner.stubs(:jasmine_config).returns('runner_output' => '')
|
||||
end
|
||||
|
||||
it 'should reverse the remove_html_file option' do
|
||||
runner.runner_filename.should == filename
|
||||
end
|
||||
end
|
||||
|
||||
context 'in yaml file' do
|
||||
before do
|
||||
runner.stubs(:jasmine_config).returns('runner_output' => yaml_output)
|
||||
end
|
||||
|
||||
it 'shoulduse the command line filename' do
|
||||
runner.runner_filename.should == filename
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user