lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb in rubysmith-4.3.0 vs lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb in rubysmith-4.4.0
- old
+ new
@@ -18,15 +18,19 @@
<% if configuration.build_refinements %>
require "refinements"
<% end %>
<% if configuration.build_refinements %>
+SPEC_ROOT = Pathname(__dir__).realpath.freeze
+
using Refinements::Pathnames
-Pathname.require_tree __dir__, "support/shared_contexts/**/*.rb"
+Pathname.require_tree SPEC_ROOT, "support/shared_contexts/**/*.rb"
<% else %>
-Dir[File.join(__dir__, "support", "shared_contexts", "**/*.rb")].each { |path| require path }
+SPEC_ROOT = Pathname(__dir__).realpath.freeze
+
+Dir[File.join(SPEC_ROOT, "support", "shared_contexts", "**/*.rb")].each { |path| require path }
<% end %>
RSpec.configure do |config|
config.color = true
config.disable_monkey_patching!