Sha256: adaf6bb59b8bbe1ee6c8eca65ca2809eed9412dc6d7a489ad5d8393b187837d1

Contents?: true

Size: 1.7 KB

Versions: 18

Compression:

Stored size: 1.7 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
require 'bundler'
Bundler.setup(:development)
require 'mail'
require 'postmark'
require 'active_support'
require 'json'
require 'fakeweb'
require 'fakeweb_matcher'
require 'rspec'
require 'rspec/its'
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'shared_examples.rb')
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'custom_matchers.rb')
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'helpers.rb')

if ENV['JSONGEM']
  # `JSONGEM=Yajl rake spec`
  Postmark.response_parser_class = ENV['JSONGEM'].to_sym
  puts "Setting ResponseParser class to #{Postmark::ResponseParsers.const_get Postmark.response_parser_class}"
end

RSpec.configure do |config|
  include Postmark::RSpecHelpers

  config.expect_with(:rspec) { |c| c.syntax = :expect }

	config.filter_run_excluding :skip_for_platform => lambda { |platform|
    RUBY_PLATFORM.to_s =~ /^#{platform.to_s}/
  }

  config.filter_run_excluding :skip_ruby_version => lambda { |version|
    versions = [*version]
    versions.any? { |v| RUBY_VERSION.to_s =~ /^#{v.to_s}/ }
  }

  config.filter_run_excluding :exclusive_for_ruby_version => lambda { |version|
    versions = [*version]
    versions.all? { |v| !(RUBY_VERSION.to_s =~ /^#{v.to_s}/) }
  }

  config.before(:each) do
    %w(api_client response_parser_class secure api_token proxy_host proxy_port
       proxy_user proxy_pass host port path_prefix http_open_timeout
       http_read_timeout max_retries).each do |var|
      Postmark.instance_variable_set(:"@#{var}", nil)
    end
    Postmark.response_parser_class = nil
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
postmark-1.23.0 spec/spec_helper.rb
postmark-1.22.3 spec/spec_helper.rb
postmark-1.22.2 spec/spec_helper.rb
postmark-1.22.1 spec/spec_helper.rb
postmark-1.22.0 spec/spec_helper.rb
postmark-1.21.8 spec/spec_helper.rb
postmark-1.21.7 spec/spec_helper.rb
postmark-1.21.6 spec/spec_helper.rb
postmark-1.21.5 spec/spec_helper.rb
postmark-1.21.4 spec/spec_helper.rb
postmark-1.21.3 spec/spec_helper.rb
postmark-1.21.2 spec/spec_helper.rb
postmark-1.21.1 spec/spec_helper.rb
postmark-1.21.0 spec/spec_helper.rb
postmark-1.20.0 spec/spec_helper.rb
postmark-1.19.2 spec/spec_helper.rb
postmark-1.19.1 spec/spec_helper.rb
postmark-1.19.0 spec/spec_helper.rb