Skip to content

Commit 55297ee

Browse files
committed
Updated tests for TruffleRuby
1 parent 131e1ca commit 55297ee

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

test/active_storage_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_no_encrypt_many
158158
# not yet supported
159159
# tries to transform the encrypted file
160160
def test_encrypt_variant
161-
skip if RUBY_ENGINE == "truffleruby"
161+
skip if truffleruby?
162162

163163
path = "test/support/image.png"
164164
User.create!(avatar: {io: File.open(path), filename: "image.png", content_type: "image/png"})
@@ -171,7 +171,7 @@ def test_encrypt_variant
171171
end
172172

173173
def test_no_encrypt_variant
174-
skip if RUBY_ENGINE == "truffleruby"
174+
skip if truffleruby?
175175

176176
path = "test/support/image.png"
177177
User.create!(image: {io: File.open(path), filename: "image.png", content_type: "image/png"})

test/model_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_dirty_nil
200200
end
201201

202202
def test_dirty_type_cast
203-
skip if mongoid?
203+
skip if mongoid? || truffleruby?
204204

205205
user = User.create!(signed_at2: Time.now)
206206
user = User.last

test/model_types_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_date_invalid
8282
end
8383

8484
def test_datetime
85-
skip if mysql?
85+
skip if mysql? || truffleruby?
8686

8787
signed_at = Time.current.round(6)
8888
assert_attribute :signed_at, signed_at, format: signed_at.utc.iso8601(9), time_zone: true
@@ -98,7 +98,7 @@ def test_datetime_invalid
9898
end
9999

100100
def test_time
101-
skip if mysql?
101+
skip if mysql? || truffleruby?
102102

103103
opens_at = Time.current.round(6).utc.change(year: 2000, month: 1, day: 1)
104104
assert_attribute :opens_at, opens_at, format: opens_at.utc.strftime("%H:%M:%S.%N")

test/test_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ def mongoid?
2424
end
2525

2626
Lockbox.master_key = SecureRandom.random_bytes(32)
27+
28+
class Minitest::Test
29+
def truffleruby?
30+
RUBY_ENGINE == "truffleruby"
31+
end
32+
end

0 commit comments

Comments
 (0)