Class: SqlTestRunner::Step

Inherits:
Struct
  • Object
show all
Defined in:
lib/sql_test_runner.rb

Direct Known Subclasses

BeforeAction, Stand

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



104
105
106
# File 'lib/sql_test_runner.rb', line 104

def block
  @block
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



104
105
106
# File 'lib/sql_test_runner.rb', line 104

def name
  @name
end

#parentObject

Returns the value of attribute parent

Returns:

  • (Object)

    the current value of parent



104
105
106
# File 'lib/sql_test_runner.rb', line 104

def parent
  @parent
end

Instance Method Details

#run(test_result, sql_connection, step_logger) ⇒ Object



105
106
107
108
109
110
111
112
# File 'lib/sql_test_runner.rb', line 105

def run(test_result, sql_connection, step_logger)
  step_logger.log_step(self)
  begin
    sql_connection.instance_eval(&block) if block
  rescue RSpec::Expectations::ExpectationNotMetError => e
    step_logger.log_error(e)
  end
end