Method: DataMiner::Script#test

Defined in:
lib/data_miner/script.rb

#test(description, settings = {}) { ... } ⇒ nil

A step that runs tests and stops the data miner on failures.

rspec-expectations are automatically included.

Examples:

Tests

data_miner do
  [...]
  test "make sure something works" do
    expect(Pet.count).to be > 10
  end
  [...]
  test "make sure something works", after: 20 do
    [...]
  end
  [...]
end

Parameters:

  • description (String)

    A description of what the block does.

  • settings (Hash) (defaults to: {})

    Settings

Options Hash (settings):

  • :after (String)

    After how many rows of the previous step to run the tests.

Yields:

  • Tests to be run

Returns:

  • (nil)

See Also:



121
122
123
# File 'lib/data_miner/script.rb', line 121

def test(description, settings = {}, &blk)
  append(:test, description, settings, &blk)
end