Class: Spec::Rake::MockTask
- Defined in:
- lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb
Class Attribute Summary collapse
-
.last_cmd ⇒ Object
Returns the value of attribute last_cmd.
-
.last_instance ⇒ Object
Returns the value of attribute last_instance.
Class Method Summary collapse
- .create_task(name, &block) ⇒ Object
- .register_task(name, block) ⇒ Object
- .reset_tasks ⇒ Object
- .task(name) ⇒ Object
- .tasks ⇒ Object
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ MockTask
constructor
A new instance of MockTask.
Constructor Details
#initialize(name, &block) ⇒ MockTask
Returns a new instance of MockTask.
28 29 30 31 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 28 def initialize(name, &block) MockTask.register_task(name, block) MockTask.last_instance = block end |
Class Attribute Details
.last_cmd ⇒ Object
Returns the value of attribute last_cmd.
9 10 11 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 9 def last_cmd @last_cmd end |
.last_instance ⇒ Object
Returns the value of attribute last_instance.
9 10 11 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 9 def last_instance @last_instance end |
Class Method Details
.create_task(name, &block) ⇒ Object
33 34 35 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 33 def self.create_task(name, &block) new(name, &block) end |
.register_task(name, block) ⇒ Object
24 25 26 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 24 def self.register_task(name, block) tasks[name] = block end |
.reset_tasks ⇒ Object
16 17 18 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 16 def self.reset_tasks @tasks = {} end |
.task(name) ⇒ Object
20 21 22 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 20 def self.task(name) tasks[name] end |
.tasks ⇒ Object
12 13 14 |
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 12 def self.tasks @tasks ||= {} end |