Skip to content

Commit

Permalink
Add off line skip feature for test
Browse files Browse the repository at this point in the history
  • Loading branch information
junaruga committed May 23, 2016
1 parent 604d6f4 commit 98cd316
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/helper.rb
Expand Up @@ -7,6 +7,11 @@

require 'gem2rpm'

# If you want to test in off line environment, set environment variable.
def skip_if_offline
skip('Skip test because of off line') if ENV['TEST_GEM2RPM_LOCAL']
end

def config
Gem2Rpm::Configuration.instance
end
Expand Down
4 changes: 2 additions & 2 deletions test/test_gem2rpm.rb
Expand Up @@ -36,9 +36,9 @@ def test_show_message_for_obj
assert_equal("foo\n\nbar\n", @out.string)
end


# TODO: Make this test work offline.
def test_find_download_url_for_source_address
skip_if_offline

assert_match %r{https?://rubygems.org/gems/}, Gem2Rpm.find_download_url("gem2rpm", "0.8.0")
end

Expand Down

0 comments on commit 98cd316

Please sign in to comment.