Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow specs to run when the code is not checked out through git.

The presence of `git` commands in my gemspec prevents bundler from being usable for `gem test vcr`.  This fixes the issue.
  • Loading branch information...
commit beb9ea0eaade9b21a9af8052111f67425e08dcc6 1 parent 26294b9
@myronmarston authored
Showing with 15 additions and 6 deletions.
  1. +9 −4 Rakefile
  2. +6 −2 spec/spec_helper.rb
View
13 Rakefile
@@ -1,13 +1,18 @@
-require 'bundler'
-require 'bundler/setup'
-Bundler::GemHelper.install_tasks
+using_git = File.exist?(File.expand_path('../.git/', __FILE__))
+
+if using_git
+ require 'bundler'
+ require 'bundler/setup'
+ Bundler::GemHelper.install_tasks
+end
require 'rake'
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
- t.rspec_opts = %w[--format progress] if ENV['FULL_BUILD']
+ t.skip_bundler = true unless using_git
+ t.rspec_opts = %w[--format progress] if (ENV['FULL_BUILD'] || !using_git)
end
desc "Run all examples using rcov"
View
8 spec/spec_helper.rb
@@ -1,6 +1,10 @@
require 'rubygems'
-require 'bundler'
-Bundler.setup
+
+using_git = File.exist?(File.expand_path('../../.git/', __FILE__))
+if using_git
+ require 'bundler'
+ Bundler.setup
+end
require 'rspec'
Please sign in to comment.
Something went wrong with that request. Please try again.