Class: Rubysmith::Builders::RSpec::Context
- Inherits:
-
Object
- Object
- Rubysmith::Builders::RSpec::Context
- Defined in:
- lib/rubysmith/builders/rspec/context.rb
Overview
Builds RSpec shared context for temporary directories.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(configuration, builder: Builder) ⇒ Context
constructor
A new instance of Context.
Constructor Details
Class Method Details
.call ⇒ Object
12 |
# File 'lib/rubysmith/builders/rspec/context.rb', line 12 def self.call(...) = new(...).call |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/rubysmith/builders/rspec/context.rb', line 19 def call return configuration unless configuration.build_rspec template = "%project_name%/spec/support/shared_contexts/temp_dir.rb.erb" configuration.merge(template_path: template) .then { |updated_configuration| builder.call updated_configuration } .render .replace(/\n\s+\n\s+/, "\n ") configuration end |