Class: Spec::Rake::MockTask

Inherits:
Object show all
Defined in:
lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_cmdObject

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_instanceObject

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_tasksObject



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

.tasksObject



12
13
14
# File 'lib/vendor/plugins/rspec/spec/spec/rake/spectask_spec.rb', line 12

def self.tasks
  @tasks ||= {}
end