Skip to content

Commit

Permalink
Fixes rubocop violations introduced by #49 (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjeldahl authored Jan 15, 2025
1 parent bd7c878 commit c185947
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ GEM
PLATFORMS
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
x86_64-linux

DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion lib/shale/schema/xml_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class XMLCompiler
# XML Schema "decimal" types
# @api private
XS_TYPE_DECIMAL = [
"#{XS_NAMESPACE_URI}:decimal"
"#{XS_NAMESPACE_URI}:decimal",
].freeze

# XML Schema "integer" types
Expand Down
2 changes: 1 addition & 1 deletion spec/shale/schema/xml_compiler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@
<xs:totalDigits value="12"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="complex3">
<xs:simpleContent>
<xs:extension base="decimal125">
Expand Down
12 changes: 6 additions & 6 deletions spec/shale/type/complex_spec/with_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ class Root < Shale::Mapper

expect(instance.type_boolean_collection).to eq([true, false])
expect(instance.type_date_collection).to eq([
Date.new(2022, 1, 1),
Date.new(2022, 1, 2),
])
Date.new(2022, 1, 1),
Date.new(2022, 1, 2),
])
expect(instance.type_decimal_collection).to eq([BigDecimal('1.1'), BigDecimal('2.2')])
expect(instance.type_float_collection).to eq([1.1, 2.2])
expect(instance.type_integer_collection).to eq([1, 2])
expect(instance.type_string_collection).to eq(%w[foo bar])
expect(instance.type_time_collection).to eq([
Time.new(2021, 1, 1, 10, 10, 10, '+01:00'),
Time.new(2021, 1, 2, 10, 10, 10, '+01:00'),
])
Time.new(2021, 1, 1, 10, 10, 10, '+01:00'),
Time.new(2021, 1, 2, 10, 10, 10, '+01:00'),
])
# expect(instance.type_value_collection).to eq(['foo', 1, true])

expect(instance.child_collection[0].type_boolean).to eq(true)
Expand Down
6 changes: 3 additions & 3 deletions spec/shale/type/decimal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

context 'when value is float' do
it 'returns BigDecimal number' do
expect(described_class.cast(123.123)).to eq(BigDecimal("123.123"))
expect(described_class.cast(123.33)).to eq(BigDecimal("123.33"))
expect(described_class.cast(123.123)).to eq(BigDecimal('123.123'))
expect(described_class.cast(123.33)).to eq(BigDecimal('123.33'))
end
end

Expand All @@ -37,7 +37,7 @@

context 'when value is anything other' do
it 'returns BigDecimal value' do
expect(described_class.cast('123.123')).to eq(BigDecimal("123.123"))
expect(described_class.cast('123.123')).to eq(BigDecimal('123.123'))
end
end
end
Expand Down

0 comments on commit c185947

Please sign in to comment.