Class: RSpec::Approvals::Executable

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/approvals/executable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, &block) ⇒ Executable

Returns a new instance of Executable.


6
7
8
9
# File 'lib/rspec/approvals/executable.rb', line 6

def initialize(command, &block)
  self.command = command
  self.on_failure = block
end

Instance Attribute Details

#commandObject

Returns the value of attribute command


5
6
7
# File 'lib/rspec/approvals/executable.rb', line 5

def command
  @command
end

#on_failureObject

Returns the value of attribute on_failure


5
6
7
# File 'lib/rspec/approvals/executable.rb', line 5

def on_failure
  @on_failure
end

Instance Method Details

#to_sObject


11
12
13
# File 'lib/rspec/approvals/executable.rb', line 11

def to_s
  command
end