Class: Dotpretty::Reporters::Basic

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

Instance Method Summary collapse

Constructor Details

#initialize(color_palette:, output:) ⇒ Basic

Returns a new instance of Basic.



7
8
9
10
11
# File 'lib/dotpretty/reporters/basic.rb', line 7

def initialize(color_palette:, output:)
  self.color_palette = color_palette
  self.extend(color_palette)
  self.output = output
end

Instance Method Details

#build_completedObject



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

def build_completed
  output.puts("Build completed")
  output.puts("")
end

#build_failed(failure_details) ⇒ Object



28
29
30
31
32
33
# File 'lib/dotpretty/reporters/basic.rb', line 28

def build_failed(failure_details)
  output.puts("Build failed")
  failure_details.each do |detail|
    output.puts(detail)
  end
end

#build_failed_to_start(raw_input_inlines) ⇒ Object



17
18
19
20
21
# File 'lib/dotpretty/reporters/basic.rb', line 17

def build_failed_to_start(raw_input_inlines)
  raw_input_inlines.each do |raw_input_line|
    output.puts(raw_input_line)
  end
end

#build_startedObject



13
14
15
# File 'lib/dotpretty/reporters/basic.rb', line 13

def build_started
  output.puts("Build started")
end

#show_test_summary(summary) ⇒ Object



54
55
56
57
58
# File 'lib/dotpretty/reporters/basic.rb', line 54

def show_test_summary(summary)
  message = colored_message(summary)
  output.puts("")
  output.puts("#{message}")
end

#starting_testsObject



35
36
37
# File 'lib/dotpretty/reporters/basic.rb', line 35

def starting_tests
  output.puts("Starting test execution...")
end

#test_failed(name:, details:) ⇒ Object



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

def test_failed(name:, details:)
  output.puts("#{red("Failed")}   #{name}")
  details.each do |line|
    output.puts(line)
  end
end

#test_passed(name:) ⇒ Object



39
40
41
# File 'lib/dotpretty/reporters/basic.rb', line 39

def test_passed(name:)
  output.puts("#{green("Passed")}   #{name}")
end

#test_skipped(name:) ⇒ Object



43
44
45
# File 'lib/dotpretty/reporters/basic.rb', line 43

def test_skipped(name:)
  output.puts("#{yellow("Skipped")}  #{name}")
end