Class: CukeForker::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- CukeForker::RakeTask
- Defined in:
- lib/cukeforker/rake_task.rb
Instance Attribute Summary collapse
-
#features ⇒ Object
Returns the value of attribute features.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opts ⇒ Object
Returns the value of attribute opts.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ RakeTask
constructor
A new instance of RakeTask.
- #run_cukeforker ⇒ Object
- #setup_ivars(args) ⇒ Object
Constructor Details
#initialize(*args, &task_block) ⇒ RakeTask
Returns a new instance of RakeTask.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cukeforker/rake_task.rb', line 11 def initialize(*args, &task_block) setup_ivars(args) desc 'Run CukeForker' unless ::Rake.application.last_comment task(name, *args) do |_, task_args| RakeFileUtils.send(:verbose, verbose) do if task_block task_block.call(*[self, task_args].slice(0, task_block.arity)) end run_cukeforker end end end |
Instance Attribute Details
#features ⇒ Object
Returns the value of attribute features.
8 9 10 |
# File 'lib/cukeforker/rake_task.rb', line 8 def features @features end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/cukeforker/rake_task.rb', line 6 def name @name end |
#opts ⇒ Object
Returns the value of attribute opts.
9 10 11 |
# File 'lib/cukeforker/rake_task.rb', line 9 def opts @opts end |
#verbose ⇒ Object
Returns the value of attribute verbose.
7 8 9 |
# File 'lib/cukeforker/rake_task.rb', line 7 def verbose @verbose end |
Instance Method Details
#run_cukeforker ⇒ Object
37 38 39 40 41 |
# File 'lib/cukeforker/rake_task.rb', line 37 def run_cukeforker unless CukeForker::Runner.run(@features, @opts) raise 'Test failures' end end |
#setup_ivars(args) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/cukeforker/rake_task.rb', line 27 def setup_ivars(args) @name = args.shift || :cukeforker split = args.index("--") if split @opts = args[0..(split-1)] @features = args[(split+1)..-1] end end |