Skip to content

Commit

Permalink
Fix conversion to seconds test to work on TruffleRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Nov 10, 2024
1 parent abc31f2 commit 58a66a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spec/unit/converter/to_seconds_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
RSpec.describe TTY::ProgressBar::Converter, "#to_seconds" do
subject(:converter) { described_class }

it "ensure 5 digit precision for < 1" do
it "ensures 5-digit precision for < 1",
unless: RSpec::Support::Ruby.truffleruby? do
expect(converter.to_seconds(0.000005)).to eq("0.00001")
end

it "ensures 5-digit precision for < 1 on TruffleRuby",
if: RSpec::Support::Ruby.truffleruby? do
expect(converter.to_seconds(0.000005)).to eq("0.00000")
end

it "rounds 0 to 0.00" do
expect(converter.to_seconds(0)).to eq(" 0.00")
end

it "ensures 2 digit precision for > 1" do
it "ensures 2-digit precision for > 1" do
expect(converter.to_seconds(11.2)).to eq("11.20")
end

Expand Down

0 comments on commit 58a66a6

Please sign in to comment.