Commit ac1cd2be authored by Harsh Chouraria's avatar Harsh Chouraria

Changes to address static-analysis failures

Rubocop warning for Time.at is ignored here intentionally
because the actual call (fixed) does have Time.at.utc
pattern that the rule fired suggests.

Removed an unnecessary newline in the spec file.
parent 347ae925
......@@ -76,7 +76,6 @@ RSpec.describe Gitlab::Ci::Ansi2json::Line do
end
describe '#set_section_duration' do
shared_examples 'set_section_duration' do
it 'sets and formats the section_duration' do
subject.set_section_duration(75)
......@@ -91,7 +90,13 @@ RSpec.describe Gitlab::Ci::Ansi2json::Line do
context 'with a timezone carrying minutes offset' do
before do
# The actual call by does use Time.at(...).utc that the following
# rubocop rule (Rails/TimeZone) suggests, but for this specific
# test's purposes we needed to mock at the Time.at call point.
# rubocop:disable Rails/TimeZone
allow(Time).to receive(:at).with(75).and_return(Time.at(75, in: '+05:30'))
# rubocop:enable Rails/TimeZone
end
it_behaves_like 'set_section_duration'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment