Class: Guard::PhantomJsJasmineTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Guard::PhantomJsJasmineTask
- Includes:
- PhantomJsJasmineCli
- Defined in:
- lib/guard/phantomjs-jasmine/task.rb
Overview
Provides a method to define a Rake task that runs the PhatomJS Jasmine specs.
Instance Attribute Summary collapse
-
#name ⇒ Object
Name of the main, top level task.
-
#options ⇒ Object
CLI options.
Instance Method Summary collapse
-
#initialize(name = 'jasmine:ci', options = {}) {|PhantomJsJasmineTask| ... } ⇒ PhantomJsJasmineTask
constructor
Initialize the Rake task.
Methods included from PhantomJsJasmineCli
Constructor Details
#initialize(name = 'jasmine:ci', options = {}) {|PhantomJsJasmineTask| ... } ⇒ PhantomJsJasmineTask
Initialize the Rake task
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/guard/phantomjs-jasmine/task.rb', line 24 def initialize(name = 'jasmine:ci', = {}) @name = name @options = yield self if block_given? namespace :phantomjs do desc 'Run all PhantomJS Jasmine specs' task(name) do begin run(self.) rescue SystemExit => e case e.status when 1 fail 'Some specs have failed' when 2 fail "The spec couldn't be run: #{ e. }'" end end end end end |
Instance Attribute Details
#name ⇒ Object
Name of the main, top level task
13 14 15 |
# File 'lib/guard/phantomjs-jasmine/task.rb', line 13 def name @name end |
#options ⇒ Object
CLI options
16 17 18 |
# File 'lib/guard/phantomjs-jasmine/task.rb', line 16 def @options end |