From f72924952c1b308e4d3ddde9bf397f156eef0a3a Mon Sep 17 00:00:00 2001 From: Samuel Giddins Date: Tue, 29 Nov 2016 18:34:33 -0600 Subject: [CLI::Gem] When using rspec, configure persistence file --- lib/bundler/templates/newgem/gitignore.tt | 5 +++++ lib/bundler/templates/newgem/spec/spec_helper.rb.tt | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1