Skip to content

Commit

Permalink
Skip tests on Ruby 3 for gems that don't support it
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Sep 20, 2021
1 parent 4589c6f commit eac29a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/active_shipping_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require_relative "test_helper"

class ActiveShippingTest < Minitest::Test
def setup
skip if ruby3?
end

def test_connect
ActiveShipping::USPS::USE_SSL[:test] = false
ActiveShipping::USPS::TEST_DOMAINS[false] = connect_host
Expand Down
4 changes: 4 additions & 0 deletions test/frontkick_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require_relative "test_helper"

class FrontkickTest < Minitest::Test
def setup
skip if ruby3?
end

def test_timeout
assert_timeout(Frontkick::Timeout) do
Frontkick.exec("sleep 10", timeout: 1)
Expand Down
2 changes: 2 additions & 0 deletions test/hipchat_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class HipchatTest < Minitest::Test
def setup
skip if ruby3?

[HipChat::Client, HipChat::Room, HipChat::User].each { |c| c.default_timeout(1) }
end

Expand Down
4 changes: 4 additions & 0 deletions test/pinterest_api_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require_relative "test_helper"

class PinterestApiTest < Minitest::Test
def setup
skip if ruby3?
end

def test_connect
Pinterest::Client.send(:remove_const, "BASE_ENDPOINT")
Pinterest::Client.const_set("BASE_ENDPOINT", "#{connect_url}/")
Expand Down
4 changes: 4 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,8 @@ def read_host_and_port
def read_url
"http://#{read_host_and_port}"
end

def ruby3?
RUBY_VERSION.to_i >= 3
end
end

0 comments on commit eac29a8

Please sign in to comment.