Module: Minitest::Reporters::Ws::Messages

Included in:
Reporter
Defined in:
lib/minitest/reporters/ws/messages.rb

Instance Method Summary collapse

Instance Method Details

#add_to_erring(test) ⇒ Object



28
29
30
31
# File 'lib/minitest/reporters/ws/messages.rb', line 28

def add_to_erring(test)
  # for now, treating erring the same as failing
  client.send_msg(prep_result(test, :add_to_erring))
end

#add_to_failing(test) ⇒ Object



24
25
26
# File 'lib/minitest/reporters/ws/messages.rb', line 24

def add_to_failing(test)
  client.send_msg(prep_result(test, :add_to_failing))
end

#add_to_passing(test) ⇒ Object



16
17
18
# File 'lib/minitest/reporters/ws/messages.rb', line 16

def add_to_passing(test)
  client.send_msg(prep_result(test, :add_to_passing))
end

#add_to_pending(test) ⇒ Object



20
21
22
# File 'lib/minitest/reporters/ws/messages.rb', line 20

def add_to_pending(test)
  client.send_msg(prep_result(test, :add_to_pending))
end

#messagesObject



4
5
6
7
8
9
10
# File 'lib/minitest/reporters/ws/messages.rb', line 4

def messages
  { start_new_iteration: { receiver: "web", method: "startNewIteration" },
    add_to_passing: { receiver: "web", method: "addToPassing" },
    add_to_pending: { receiver: "web", method: "addToPending" },
    add_to_erring: { receiver: "web", method: "addToFailing" },
    add_to_failing: { receiver: "web", method: "addToFailing" } }
end

#start_new_iteration(test_count = 420) ⇒ Object



12
13
14
# File 'lib/minitest/reporters/ws/messages.rb', line 12

def start_new_iteration(test_count = 420)
  client.send_msg(messages[:start_new_iteration].merge arguments: [@timestamp, test_count])
end