Sha256: 19de4156150bdef9395186b95c5c74531b64908530ced08e53044c584f73add7

Contents?: true

Size: 864 Bytes

Versions: 6

Compression:

Stored size: 864 Bytes

Contents

#$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'rspec'
require 'lumberg'
require 'lumberg/exceptions'
require 'vcr'
require 'timeout'

# Load supporting files in spec/support
Dir["#{Lumberg::base_path}/../spec/support/**/*.rb"].each do |f|
  require f
end

VCR.configure do |c|
  c.cassette_library_dir = 'spec/vcr_cassettes'
  c.hook_into :webmock
  c.default_cassette_options = { record: :none }
end

def live_test?
  !ENV['WHM_REAL'].nil?
end

def requires_attr(attr, &block)
  expect { block.call }.to raise_error(Lumberg::WhmArgumentError, /Missing required parameter: #{attr}/i)
end

RSpec.configure do |c|
  c.extend VCR::RSpec::Macros
  c.before(:each) do
    if live_test?
      @whm_hash = ENV['WHM_HASH'].dup
      @whm_host = ENV['WHM_HOST'].dup
    else
      @whm_hash = 'iscool'
      @whm_host = 'myhost.com'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lumberg-2.0.0.pre12 spec/spec_helper.rb
lumberg-2.0.0.pre9 spec/spec_helper.rb
lumberg-2.0.0.pre8 spec/spec_helper.rb
lumberg-2.0.0.pre7 spec/spec_helper.rb
lumberg-2.0.0.pre6 spec/spec_helper.rb
lumberg-2.0.0.pre5 spec/spec_helper.rb