start of file listing
This commit is contained in:
parent
47f6fead79
commit
ebe5b03e36
@ -13,8 +13,19 @@ require 'jasmine/headless/runner'
|
||||
require 'jasmine/headless/options'
|
||||
|
||||
begin
|
||||
options = Jasmine::Headless::Options.from_command_line
|
||||
runner = Jasmine::Headless::Runner.new(options)
|
||||
|
||||
if options[:do_list]
|
||||
files_list = Jasmine::FilesList.new(
|
||||
:config => runner.jasmine_config
|
||||
)
|
||||
|
||||
files_list.files.each { |file| puts file }
|
||||
else
|
||||
puts "Running Jasmine specs...".color(:white)
|
||||
exit Jasmine::Headless::Runner.run(Jasmine::Headless::Options.from_command_line)
|
||||
exit runner.run
|
||||
end
|
||||
rescue CoffeeScript::CompilationError
|
||||
exit 1
|
||||
rescue StandardError => e
|
||||
|
@ -13,6 +13,7 @@ module Jasmine
|
||||
:remove_html_file => true,
|
||||
:jasmine_config => 'spec/javascripts/support/jasmine.yml',
|
||||
:report => false,
|
||||
:do_list => false,
|
||||
:full_run => true,
|
||||
:files => []
|
||||
}
|
||||
@ -48,6 +49,8 @@ module Jasmine
|
||||
@options[:jasmine_config] = arg
|
||||
when '--no-full-run'
|
||||
@options[:full_run] = false
|
||||
when '--list', '-l'
|
||||
@options[:do_list] = true
|
||||
end
|
||||
end
|
||||
|
||||
@ -66,7 +69,8 @@ module Jasmine
|
||||
[ '--keep', GetoptLong::NO_ARGUMENT ],
|
||||
[ '--report', GetoptLong::REQUIRED_ARGUMENT ],
|
||||
[ '--jasmine-config', '-j', GetoptLong::REQUIRED_ARGUMENT ],
|
||||
[ '--no-full-run', GetoptLong::NO_ARGUMENT ]
|
||||
[ '--no-full-run', GetoptLong::NO_ARGUMENT ],
|
||||
[ '--list', '-l', GetoptLong::NO_ARGUMENT ]
|
||||
)
|
||||
|
||||
command_line_args.each { |*args| process_option(*args) }
|
||||
|
@ -116,5 +116,16 @@ describe "jasmine-headless-webkit" do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
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}
|
||||
p files
|
||||
$?.exitstatus.should == 0
|
||||
|
||||
files.lines.to_a.should include("./spec/jasmine/success/success.js\n")
|
||||
files.lines.to_a.should include("./spec/jasmine/success/success_spec.js\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user