Class: RspecWeb::Formatter
- Inherits:
-
RSpec::Core::Formatters::BaseFormatter
- Object
- RSpec::Core::Formatters::BaseFormatter
- RspecWeb::Formatter
- Defined in:
- lib/rspec_web/formatter.rb
Instance Method Summary collapse
- #close ⇒ Object
- #dump_failed(example) ⇒ Object
- #dump_failures ⇒ Object
- #dump_pending ⇒ Object
- #dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object
- #example_failed(example) ⇒ Object
- #example_group_finished(example_group) ⇒ Object
- #example_group_started(example_group) ⇒ Object
- #example_passed(example) ⇒ Object
- #example_pending(example) ⇒ Object
- #example_started(example) ⇒ Object
- #format_backtrace(backtrace, example) ⇒ Object
- #message(message) ⇒ Object
- #start(example_count) ⇒ Object
- #start_dump ⇒ Object
Instance Method Details
#close ⇒ Object
50 51 52 53 54 55 |
# File 'lib/rspec_web/formatter.rb', line 50 def close puts "Specs finished!.. " = { receiver: "server", method: "disconnect", arguments: ["rspec"] } @socket.send(.to_json) @socket.close end |
#dump_failed(example) ⇒ Object
43 |
# File 'lib/rspec_web/formatter.rb', line 43 def dump_failed(example); end |
#dump_failures ⇒ Object
46 |
# File 'lib/rspec_web/formatter.rb', line 46 def dump_failures; end |
#dump_pending ⇒ Object
47 |
# File 'lib/rspec_web/formatter.rb', line 47 def dump_pending; end |
#dump_summary(duration, example_count, failure_count, pending_count) ⇒ Object
44 |
# File 'lib/rspec_web/formatter.rb', line 44 def dump_summary(duration, example_count, failure_count, pending_count); end |
#example_failed(example) ⇒ Object
36 37 38 39 40 |
# File 'lib/rspec_web/formatter.rb', line 36 def example_failed(example) data = example_to_hash(example) = { receiver: "web", method: "addToFailing", arguments: [@timestamp, data] } @socket.send(.to_json) end |
#example_group_finished(example_group) ⇒ Object
21 |
# File 'lib/rspec_web/formatter.rb', line 21 def example_group_finished(example_group); end |
#example_group_started(example_group) ⇒ Object
20 |
# File 'lib/rspec_web/formatter.rb', line 20 def example_group_started(example_group); end |
#example_passed(example) ⇒ Object
24 25 26 27 28 |
# File 'lib/rspec_web/formatter.rb', line 24 def example_passed(example) data = example_to_hash(example) = { receiver: "web", method: "addToPassing", arguments: [@timestamp, data] } @socket.send(.to_json) end |
#example_pending(example) ⇒ Object
30 31 32 33 34 |
# File 'lib/rspec_web/formatter.rb', line 30 def example_pending(example) data = example_to_hash(example) = { receiver: "web", method: "addToPending", arguments: [@timestamp, data] } @socket.send(.to_json) end |
#example_started(example) ⇒ Object
22 |
# File 'lib/rspec_web/formatter.rb', line 22 def example_started(example); end |
#format_backtrace(backtrace, example) ⇒ Object
48 |
# File 'lib/rspec_web/formatter.rb', line 48 def format_backtrace(backtrace, example); end |
#message(message) ⇒ Object
45 |
# File 'lib/rspec_web/formatter.rb', line 45 def (); end |
#start(example_count) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rspec_web/formatter.rb', line 9 def start(example_count) @timestamp = Time.now.to_i @socket = WebSocket.new("ws://localhost:10081") = { receiver: "server", method: "identify", arguments: ["rspec"] } @socket.send(.to_json) = { receiver: "web", method: "startNewIteration", arguments: [@timestamp, example_count] } @socket.send(.to_json) end |
#start_dump ⇒ Object
42 |
# File 'lib/rspec_web/formatter.rb', line 42 def start_dump; end |