Class: Dotpretty::Reporters::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/dotpretty/reporters/browser.rb

Instance Method Summary collapse

Constructor Details

#initialize(http_client:) ⇒ Browser

Returns a new instance of Browser.



5
6
7
# File 'lib/dotpretty/reporters/browser.rb', line 5

def initialize(http_client:)
  self.http_client = http_client
end

Instance Method Details

#build_completedObject



9
10
# File 'lib/dotpretty/reporters/browser.rb', line 9

def build_completed
end

#build_failed(failure_details) ⇒ Object



15
16
# File 'lib/dotpretty/reporters/browser.rb', line 15

def build_failed(failure_details)
end

#build_failed_to_start(raw_input_inlines) ⇒ Object



12
13
# File 'lib/dotpretty/reporters/browser.rb', line 12

def build_failed_to_start(raw_input_inlines)
end

#build_startedObject



18
19
20
# File 'lib/dotpretty/reporters/browser.rb', line 18

def build_started
  http_client.post_json("/build_started")
end

#show_test_summary(test_summary) ⇒ Object



22
23
24
25
26
# File 'lib/dotpretty/reporters/browser.rb', line 22

def show_test_summary(test_summary)
  http_client.post_json("/update_results", {
    tests: tests
  })
end

#starting_testsObject



28
29
30
# File 'lib/dotpretty/reporters/browser.rb', line 28

def starting_tests
  self.tests = []
end

#test_failed(name:, details:) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/dotpretty/reporters/browser.rb', line 32

def test_failed(name:, details:)
  tests << {
    details: details,
    name: name,
    result: "failed"
  }
end

#test_passed(name:) ⇒ Object



40
41
42
43
44
45
# File 'lib/dotpretty/reporters/browser.rb', line 40

def test_passed(name:)
  tests << {
    name: name,
    result: "passed"
  }
end

#test_skipped(name:) ⇒ Object



47
48
49
50
51
52
# File 'lib/dotpretty/reporters/browser.rb', line 47

def test_skipped(name:)
  tests << {
    name: name,
    result: "skipped"
  }
end