Skip to content

Commit

Permalink
Refactoring #4 and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blackchestnut committed Jun 20, 2023
1 parent bbb3425 commit 08b8a86
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/invest_tinkoff/v2/quotation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.create price
units = price.to_i
nano = ((price.to_d - units) * 1_000_000_000).to_i
new(
"#{price.positive? ? '' : '-'}#{units.abs}".to_i,
units,
nano
)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/invest_tinkoff/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module InvestTinkoff
VERSION = '0.9.6.6'
VERSION = '0.9.6.7'
end
12 changes: 6 additions & 6 deletions spec/invest_tinkoff/v2/quotation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

it do
is_expected.to have_attributes(
units: '114',
units: 114,
nano: 250_000_000
)
end
Expand All @@ -22,7 +22,7 @@

it do
is_expected.to have_attributes(
units: '-200',
units: -200,
nano: -200_000_000
)
end
Expand All @@ -33,7 +33,7 @@

it do
is_expected.to have_attributes(
units: '0',
units: 0,
nano: 10_000_000
)
end
Expand All @@ -44,7 +44,7 @@

it do
is_expected.to have_attributes(
units: '-0',
units: -0,
nano: -10_000_000
)
end
Expand All @@ -55,7 +55,7 @@

it do
is_expected.to have_attributes(
units: '22',
units: 22,
nano: 30_000_000
)
end
Expand All @@ -66,7 +66,7 @@

it do
is_expected.to have_attributes(
units: '21',
units: 21,
nano: 880_000_000
)
end
Expand Down

0 comments on commit 08b8a86

Please sign in to comment.