Skip to content

Commit 2885c3a

Browse files
committed
change tests accoring to changed logic
1 parent 311bb73 commit 2885c3a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

test/float_type_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
describe 'when value is Nil' do
2323
it 'returns nil' do
24-
assert_nil type.coerce(nil)
24+
type.coerce(nil).must_equal 0
2525
end
2626
end
2727

2828
describe 'when allow_nil is true' do
2929
it 'returns float' do
30-
type.coerce(nil, allow_nil: true).must_equal 0.0
30+
assert_nil type.coerce(nil, allow_nil: true)
3131
end
3232
end
3333

test/integer_type_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
describe 'when value is Nil' do
2222
it 'returns nil' do
23-
assert_nil type.coerce(nil)
23+
type.coerce(nil).must_equal 0
2424
end
2525
end
2626

2727
describe 'when allow_nil is true' do
2828
it 'returns integer' do
29-
type.coerce(nil, allow_nil: true).must_equal 0
29+
assert_nil type.coerce(nil, allow_nil: true)
3030
end
3131
end
3232

test/shallow_attributes_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def default_color
140140
user.name = nil
141141
user.age = nil
142142
user.admin = nil
143-
user.attributes.must_equal(name: '', age: nil, last_name: "Affleck", full_name: "Anton Affleck", color: "Pink", friends_count: 0, sizes: [], admin: false)
143+
user.attributes.must_equal(name: '', age: 0, last_name: "Affleck", full_name: "Anton Affleck", color: "Pink", friends_count: 0, sizes: [], admin: false)
144144
end
145145
end
146146
end

test/string_type_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
describe 'when allow_nil is true' do
3434
it 'returns integer' do
35-
type.coerce(nil, allow_nil: true).must_equal ''
35+
assert_nil type.coerce(nil, allow_nil: true)
3636
end
3737
end
3838

0 commit comments

Comments
 (0)