test/test_gem.rb in zold-0.14.39 vs test/test_gem.rb in zold-0.14.40
- old
+ new
@@ -4,14 +4,18 @@
require 'webmock/minitest'
require 'minitest/autorun'
class TestGem < Minitest::Test
def test_last_version
- gem = Zold::Gem.new
version = (1..3).map { rand(9).to_s } .join('.')
- stub_request(:get, 'http://rubygems.org/api/v1/versions/zold/latest.json').to_return(
+ stub_request(:get, 'https://rubygems.org/api/v1/versions/zold/latest.json').to_return(
status: 200,
body: "{\"version\": \"#{version}\"}"
)
- assert_equal(version, gem.last_version)
+ assert_equal(version, Zold::Gem.new.last_version)
+ end
+
+ def test_last_version_live
+ WebMock.allow_net_connect!
+ assert(!Zold::Gem.new.last_version.nil?)
end
end