Sha256: cd8eb22263e24cd50a0a63550ed06078620bf8c820d58a0b27917c5d4d6d2e44

Contents?: true

Size: 889 Bytes

Versions: 7

Compression:

Stored size: 889 Bytes

Contents

require 'simplecov'
SimpleCov.start do
  add_filter "spec/"
end

require 'yaml'
require File.dirname(__FILE__) + "/../lib/pag_seguro"

config = YAML.load_file(File.dirname(__FILE__) + "/pag_seguro/integration/config.yml")
EMAIL = config["email"]
TOKEN = config["token"]
NOTIFICATION_CODE = config["notification_code"]

class HaveAttributeAccessor
  def initialize(attribute)
    @attribute = attribute
  end
  
  def matches?(target)
    @target = target
    @target.respond_to?(:"#{@attribute}").should == true
    @target.respond_to?(:"#{@attribute}=").should == true
  end
  
  def failure_message
    "expected #{@target.inspect} to have '#{@expected}' attribute accessor"
  end
  
  def negative_failure_message
    "expected #{@target.inspect} not to have '#{@expected}' attribute accessor"
  end
end

def have_attribute_accessor(attribute)
  HaveAttributeAccessor.new(attribute)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pag_seguro-0.2.3 spec/spec_helper.rb
pag_seguro-0.2.2 spec/spec_helper.rb
pag_seguro-0.2.1 spec/spec_helper.rb
pag_seguro-0.2.0 spec/spec_helper.rb
pag_seguro-0.1.9 spec/spec_helper.rb
pag_seguro-0.1.8 spec/spec_helper.rb
pag_seguro-0.1.7 spec/spec_helper.rb