Sha256: faec310024a2a44d373f79e898c165a3483c72d4f3891c98c43c150fd627f5bd

Contents?: true

Size: 854 Bytes

Versions: 26

Compression:

Stored size: 854 Bytes

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'test/unit'
require 'mocha'
require 'whois'


module ConnectivityTestHelper
  def self.included(base)
    base.extend ClassMethods
  end

  module ClassMethods

    def need_connectivity(&block)
      if connectivity_available?
        yield
      end
    end

    def connectivity_available?
      ENV["ONLINE"].to_i == 1
    end

  end
end


class Test::Unit::TestCase
  include ConnectivityTestHelper
end


class Whois::Answer::Parser::TestCase < Test::Unit::TestCase

  def test_true
    true
  end

  def testcase_path
    File.expand_path(File.dirname(__FILE__) + "/testcases/responses/#{@host}")
  end


  protected

    def load_part(path)
      part(File.read(testcase_path + path), @host)
    end

    def part(*args)
      Whois::Answer::Part.new(*args)
    end
  
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
whois-1.2.2 test/test_helper.rb
whois-1.2.1 test/test_helper.rb
whois-1.2.0 test/test_helper.rb
whois-1.1.8 test/test_helper.rb
whois-1.1.7 test/test_helper.rb
whois-1.1.6 test/test_helper.rb
whois-1.1.5 test/test_helper.rb
whois-1.1.4 test/test_helper.rb
whois-1.1.3 test/test_helper.rb
whois-1.1.2 test/test_helper.rb
whois-1.1.1 test/test_helper.rb
whois-1.1.0 test/test_helper.rb
whois-1.0.12 test/test_helper.rb
whois-1.0.11 test/test_helper.rb
whois-1.0.10 test/test_helper.rb
whois-1.0.9 test/test_helper.rb
whois-1.0.8 test/test_helper.rb
whois-1.0.7 test/test_helper.rb
whois-1.0.6 test/test_helper.rb
whois-1.0.5 test/test_helper.rb