Sha256: 311a6933b12e7a77663abc0c3a3cc33c94bb218598cd1285d1f4de84668fa95e

Contents?: true

Size: 639 Bytes

Versions: 5

Compression:

Stored size: 639 Bytes

Contents

module RSpecSupportSpecHelpers

  def fixture(*names)
    File.join(SPEC_ROOT, "fixtures", *names)
  end

  private

  # Temporary resets Server @@definitions
  # to let the test setup a custom definition list.
  def with_definitions
    definitions_setup
    yield
  ensure
    definitions_teardown
  end

  def definitions_setup
    @_definitions = Whois::Server.send :instance_variable_get, :@definitions
    Whois::Server.clear_definitions
  end

  def definitions_teardown
    Whois::Server.send :instance_variable_set, :@definitions, @_definitions
  end

end

RSpec.configure do |config|
  config.include RSpecSupportSpecHelpers
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
whois-parser-2.0.0 spec/support/helpers/spec_helper.rb
whois-5.0.1 spec/support/helpers/spec_helper.rb
whois-5.0.0 spec/support/helpers/spec_helper.rb
whois-parser-1.2.0 spec/support/helpers/spec_helper.rb
whois-4.1.0 spec/support/helpers/spec_helper.rb