Permalink
Browse files

Run Braintree integration specs.

  • Loading branch information...
1 parent 33f0a96 commit ca158996b89b06e6c40bdb7f938dc7e6c16e7f09 @gabebw gabebw committed Jun 29, 2012
Showing with 32 additions and 2 deletions.
  1. +10 −2 Rakefile
  2. +4 −0 fake_braintree.gemspec
  3. +18 −0 spec/integration_spec.rb
View
12 Rakefile
@@ -2,7 +2,15 @@ require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new(:spec)
+RSpec::Core::RakeTask.new(:spec) do |t|
+ # Don't include Braintree integration specs
+ t.pattern = 'spec/{fake_braintree*/**.rb}'
+end
+
+RSpec::Core::RakeTask.new(:braintree_integration) do |t|
+ # Include Braintree integration specs
+ t.pattern = 'spec/integration_spec.rb'
+end
desc 'Run specs'
-task :default => [:spec]
+task :default => [:spec, :braintree_integration]
View
4 fake_braintree.gemspec
@@ -29,4 +29,8 @@ Gem::Specification.new do |s|
s.add_development_dependency 'spork', '~> 0.9.0.rc9'
s.add_development_dependency 'bundler', '>= 1.0.14'
s.add_development_dependency 'rake'
+
+ # Gems required for running Braintree integration specs
+ s.add_development_dependency 'libxml-ruby'
+ s.add_development_dependency 'rake_commit'
end
View
18 spec/integration_spec.rb
@@ -0,0 +1,18 @@
+# Find Braintree spec/ dir
+braintree_spec_dir = nil
+$LOAD_PATH.detect do |dir|
+ if File.exists?(File.join(dir, "braintree.rb"))
+ braintree_spec_dir = File.expand_path(File.join(dir,"..","spec"))
+ $LOAD_PATH.unshift(braintree_spec_dir)
+ end
+end
+
+# Used by braintree spec_helper
+ENV["LIBXML_VERSION"] = Gem.loaded_specs['libxml-ruby'].version.to_s
+ENV["BUILDER_VERSION"] = Gem.loaded_specs['builder'].version.to_s
+
+require File.join(braintree_spec_dir, 'integration', 'spec_helper')
+
+Dir[File.join(braintree_spec_dir, 'integration', '**', '*_spec.rb')].each do |f|
+ require File.expand_path(f)
+end

0 comments on commit ca15899

Please sign in to comment.