Sha256: 99a49d0716ef3854fb28cb445e26e4ebca291091caf1394e18df684b3dcf9678
Contents?: true
Size: 1.39 KB
Versions: 6
Compression:
Stored size: 1.39 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/autorun' require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'shared_examples.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.filter_run_excluding :skip_for_platform => lambda { |platform| RUBY_PLATFORM.to_s =~ /^#{platform.to_s}/ } config.before(:each) do %w(api_client response_parser_class secure api_key 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 RSpec::Matchers.define :be_serialized_to do |json| match do |mail_message| Postmark.convert_message_to_options_hash(mail_message).should == JSON.parse(json) end end
Version data entries
6 entries across 6 versions & 1 rubygems