lib/gemsmith/builders/rspec/helper.rb in gemsmith-19.8.0 vs lib/gemsmith/builders/rspec/helper.rb in gemsmith-20.0.0
- old
+ new
@@ -17,31 +17,18 @@
end
def call
return configuration unless configuration.build_rspec && configuration.build_cli
- update_spec_helper
- render_shared_example
+ builder.call(configuration.merge(template_path: "%project_name%/spec/spec_helper.rb.erb"))
+ .touch
+ .replace("%r(^/spec/)", "%r((.+/container\\.rb|^/spec/))")
configuration
end
private
attr_reader :configuration, :builder
-
- def update_spec_helper
- builder.call(configuration.merge(template_path: "%project_name%/spec/spec_helper.rb.erb"))
- .touch
- .insert_after(
- %r(support/shared_contexts),
- %(Pathname.require_tree SPEC_ROOT.join("support/shared_examples")\n)
- )
- end
-
- def render_shared_example
- path = "%project_name%/spec/support/shared_examples/a_parser.rb.erb"
- builder.call(configuration.merge(template_path: path)).render
- end
end
end
end
end