-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
Signed-off-by: Vitalii Chulak <vitalii@daynix.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require_relative '../../../lib/auxiliary/time_helper.rb' | ||
Check notice Code scanning / Rubocop Add the frozen_string_literal comment to the top of files to help transition to frozen string literals by default. Note
Style/FrozenStringLiteralComment: Missing frozen string literal comment.
Check notice Code scanning / Rubocop Checks for the presence of superfluous `.rb` extension in the filename provided to `require` and `require_relative`. Note
Style/RedundantFileExtensionInRequire: Redundant .rb file extension detected.
|
||
|
||
RSpec.describe AutoHCK::Helper do | ||
include AutoHCK::Helper | ||
|
||
describe '#time_to_seconds' do | ||
|
||
Check notice Code scanning / Rubocop Avoid trailing whitespace. Note
Layout/TrailingWhitespace: Trailing whitespace detected.
|
||
time_strings = { | ||
"1:2" => 3720, #hh:mm | ||
Check notice Code scanning / Rubocop Checks if uses of quotes match the configured preference. Note
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Check notice Code scanning / Rubocop Comments should start with a space. Note
Layout/LeadingCommentSpace: Missing space after #.
|
||
"1:2:3" => 3723, #hh:mm:ss | ||
Check notice Code scanning / Rubocop Checks if uses of quotes match the configured preference. Note
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Check notice Code scanning / Rubocop Comments should start with a space. Note
Layout/LeadingCommentSpace: Missing space after #.
|
||
"1.2:3" => 86400 + 7380, #dd.hh:mm | ||
Check notice Code scanning / Rubocop Checks if uses of quotes match the configured preference. Note
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Check notice Code scanning / Rubocop Add underscores to large numeric literals to improve their readability. Note
Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them.
Check notice Code scanning / Rubocop Comments should start with a space. Note
Layout/LeadingCommentSpace: Missing space after #.
|
||
"1.2:3:4" => 86400 + 7380 + 4, #dd.hh:mm:ss | ||
Check notice Code scanning / Rubocop Checks if uses of quotes match the configured preference. Note
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Check notice Code scanning / Rubocop Add underscores to large numeric literals to improve their readability. Note
Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them.
Check notice Code scanning / Rubocop Comments should start with a space. Note
Layout/LeadingCommentSpace: Missing space after #.
|
||
"1:2:3.22" => 3723.22, #hh:mm:ss.ff | ||
Check notice Code scanning / Rubocop Checks if uses of quotes match the configured preference. Note
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Check notice Code scanning / Rubocop Comments should start with a space. Note
Layout/LeadingCommentSpace: Missing space after #.
|
||
"1.2:3:4.22" => 86400 + 7380 + 4.22, #dd.hh:mm:ss.ff | ||
Check notice Code scanning / Rubocop Checks if uses of quotes match the configured preference. Note
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
Check notice Code scanning / Rubocop Add underscores to large numeric literals to improve their readability. Note
Style/NumericLiterals: Use underscores(_) as thousands separator and separate every 3 digits with them.
Check notice Code scanning / Rubocop Checks for trailing comma in hash literals. Note
Style/TrailingCommaInHashLiteral: Avoid comma after the last item of a hash.
Check notice Code scanning / Rubocop Comments should start with a space. Note
Layout/LeadingCommentSpace: Missing space after #.
|
||
} | ||
|
||
time_strings.each do |time, expected| | ||
it "correctly converts '#{time}' to #{expected} seconds" do | ||
expect(time_to_seconds(time)).to eq(expected) | ||
end | ||
end | ||
end | ||
end | ||
Check notice Code scanning / Rubocop Checks trailing blank lines and final newline. Note
Layout/TrailingEmptyLines: Final newline missing.
|