Class: ATMCreateTestFormatter

Inherits:
ATMFormatter::BaseFormatter show all
Defined in:
lib/atm_create_test_formatter.rb

Constant Summary

Constants inherited from ATMFormatter::BaseFormatter

ATMFormatter::BaseFormatter::DEFAULT_OPTIONS, ATMFormatter::BaseFormatter::NOTIFICATIONS

Instance Method Summary collapse

Methods inherited from ATMFormatter::BaseFormatter

#start

Instance Method Details

#example_started(notification) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/atm_create_test_formatter.rb', line 6

def example_started(notification)
  if (notification.example..key?(:test_id) && !notification.example.[:test_id].strip.empty?) || !notification.example..key?(:test_id)
    return
  end

  response = @client.TestCase.create(process_example(notification.example))
  if response.code != 201
    puts ATM::TestCaseError.new(response).message
    exit
  end

  update_local_test(notification.example, response['key'])
end