Sha256: 7b264ec8f92da6633ddee5f9338caf1436d7cbf3b80820c72fe29a2f369d6981

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 KB

Contents

$LOAD_PATH << "." unless $LOAD_PATH.include?(".")

begin
  require "rubygems"
  require "bundler"

  if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.5")
    raise RuntimeError, "Your bundler version is too old." +
     "Run `gem install bundler` to upgrade."
  end

  # Set up load paths for all bundled gems
  Bundler.setup
rescue Bundler::GemNotFound
  raise RuntimeError, "Bundler couldn't find some gems." +
    "Did you run \`bundlee install\`?"
end

Bundler.require

require File.expand_path('../../lib/wp_wrapper', __FILE__)

RSpec.configure do |config|
  config.mock_with :mocha
end

def load_config
  config_path   =   File.exists?(File.expand_path('../wordpress.yml', __FILE__)) ? File.expand_path('../wordpress.yml', __FILE__) : File.expand_path('../wordpress.yml.example', __FILE__)
  config        =   YAML.load_file(config_path)
  config.symbolize_keys! if config.respond_to?(:symbolize_keys!)
  
  return config
end

def init_admin_connection
  config = load_config
  WpWrapper::Client.new(config[:admin])
end

def init_invalid_connection
  config = load_config
  WpWrapper::Client.new(config[:invalid])
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wp_wrapper-0.0.7 spec/spec_helper.rb
wp_wrapper-0.0.6 spec/spec_helper.rb
wp_wrapper-0.0.5 spec/spec_helper.rb
wp_wrapper-0.0.4 spec/spec_helper.rb
wp_wrapper-0.0.3 spec/spec_helper.rb
wp_wrapper-0.0.2 spec/spec_helper.rb