Skip to content

[Ruby] refactor: Introduce rubocop into CI pipeline #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Hardcode location to assets template
  • Loading branch information
luke-hill committed Sep 16, 2024
commit 5bd9ed813158eec3c4bb130be038bdf65b534eb3
2 changes: 1 addition & 1 deletion ruby/lib/cucumber/html_formatter/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def post_message
end

def template_writer
@template_writer ||= TemplateWriter.new(AssetsLoader.template)
@template_writer ||= TemplateWriter.new
end
end
end
Expand Down
5 changes: 3 additions & 2 deletions ruby/lib/cucumber/html_formatter/template_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ module Cucumber
module HTMLFormatter
class TemplateWriter
attr_reader :template
private :template

def initialize(template)
@template = template
def initialize
@template = AssetsLoader.template
end

def write_between(from, to)
Expand Down
6 changes: 5 additions & 1 deletion ruby/spec/cucumber/html_formatter/template_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

describe Cucumber::HTMLFormatter::TemplateWriter do
describe '#write_between' do
subject(:template_writer) { described_class.new(template) }
subject(:template_writer) { described_class.new }

before do
allow(Cucumber::HTMLFormatter::AssetsLoader).to receive(:template).and_return(template)
end

let(:template) { 'Some template {{here}} with content after' }

Expand Down