Class: Shaf::Command::Test::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/shaf/command/test/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runnable, method_name = nil) ⇒ Runner

Returns a new instance of Runner.



8
9
10
11
# File 'lib/shaf/command/test/runner.rb', line 8

def initialize(runnable, method_name = nil)
  @runnable = runnable
  @method_name = method_name
end

Instance Attribute Details

#method_nameObject (readonly)

Returns the value of attribute method_name.



6
7
8
# File 'lib/shaf/command/test/runner.rb', line 6

def method_name
  @method_name
end

#runnableObject (readonly)

Returns the value of attribute runnable.



6
7
8
# File 'lib/shaf/command/test/runner.rb', line 6

def runnable
  @runnable
end

Instance Method Details

#call(reporter) ⇒ Object



13
14
15
# File 'lib/shaf/command/test/runner.rb', line 13

def call(reporter)
  runnable.run(reporter, options)
end

#optionsObject



17
18
19
20
21
# File 'lib/shaf/command/test/runner.rb', line 17

def options
  return {} unless method_name

  {filter: method_name}
end