summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2016-12-17 14:34:09 +0000
committerThe Bundler Bot <bot@bundler.io>2016-12-17 14:34:09 +0000
commit0d33c94a4ae5ed9327263786c5c107f29b9aba03 (patch)
tree83cdf910f3f084b0be483fdac3c1f4f4e7921a08
parent9531f7313f2444455ec4bddfc516e2ebffce2650 (diff)
parentf72924952c1b308e4d3ddde9bf397f156eef0a3a (diff)
downloadbundler-0d33c94a4ae5ed9327263786c5c107f29b9aba03.tar.gz
Auto merge of #5216 - bundler:seg-bundle-gem-rspec-persistence, r=indirect
[CLI::Gem] When using rspec, configure persistence file aka make my life easier when working with new gems.
-rw-r--r--lib/bundler/templates/newgem/gitignore.tt5
-rw-r--r--lib/bundler/templates/newgem/spec/spec_helper.rb.tt11
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/bundler/templates/newgem/gitignore.tt b/lib/bundler/templates/newgem/gitignore.tt
index ebff7ac53c..573d76b4c2 100644
--- a/lib/bundler/templates/newgem/gitignore.tt
+++ b/lib/bundler/templates/newgem/gitignore.tt
@@ -14,3 +14,8 @@
*.a
mkmf.log
<%- end -%>
+<%- if config[:test] == "rspec" -%>
+
+# rspec failure tracking
+.rspec_status
+<%- end -%>
diff --git a/lib/bundler/templates/newgem/spec/spec_helper.rb.tt b/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
index 4c69d354b3..a5e7f92ffe 100644
--- a/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
+++ b/lib/bundler/templates/newgem/spec/spec_helper.rb.tt
@@ -1,2 +1,11 @@
-$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
+require "bundler/setup"
require "<%= config[:namespaced_path] %>"
+
+RSpec.configure do |config|
+ # Enable flags like --only-failures and --next-failure
+ config.example_status_persistence_file_path = ".rspec_status"
+
+ config.expect_with :rspec do |c|
+ c.syntax = :expect
+ end
+end