Class: RspecGithubActionsSummary::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_github_actions_summary/example_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ ExampleGroup

Returns a new instance of ExampleGroup.



7
8
9
# File 'lib/rspec_github_actions_summary/example_group.rb', line 7

def initialize(file_path)
  @file_path = file_path
end

Instance Attribute Details

#file_pathObject (readonly)

Returns the value of attribute file_path.



5
6
7
# File 'lib/rspec_github_actions_summary/example_group.rb', line 5

def file_path
  @file_path
end

Instance Method Details

#render_failed_examplesObject



22
23
24
25
26
27
28
# File 'lib/rspec_github_actions_summary/example_group.rb', line 22

def render_failed_examples
  return [] if json['failed'].empty?

  json['failed'].map do |j|
    "bin/rspec #{j["path"]} # #{j["desc"]}"
  end
end

#write_rowObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/rspec_github_actions_summary/example_group.rb', line 11

def write_row
  [
    passed? ? '✅ Pass' : '❌ Failed',
    json['passed_specs'],
    json['failed_specs'],
    json['skipped_specs'],
    json['total_specs'],
    duration
  ]
end