2011-05-17 11:47:42 +00:00
|
|
|
module Jasmine
|
|
|
|
module Headless
|
|
|
|
class Task
|
2011-06-16 23:33:36 +00:00
|
|
|
begin
|
|
|
|
include Rake::DSL
|
|
|
|
rescue NameError
|
|
|
|
# never mind
|
|
|
|
end
|
2011-06-16 21:34:00 +00:00
|
|
|
|
2011-05-17 11:47:42 +00:00
|
|
|
attr_accessor :colors, :keep_on_error, :jasmine_config
|
|
|
|
|
|
|
|
def initialize(name = 'jasmine:headless')
|
|
|
|
@colors = false
|
|
|
|
@keep_on_error = false
|
|
|
|
@jasmine_config = nil
|
|
|
|
|
|
|
|
yield self if block_given?
|
|
|
|
|
|
|
|
desc 'Run Jasmine specs headlessly'
|
|
|
|
task name do
|
|
|
|
system %{jasmine-headless-webkit #{@colors ? "-c" : "--no-colors"} #{@keep_on_error ? "--keep" : ""} #{@jasmine_config ? "-j #{@jasmine_config}" : ""}}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|