Class: Rubysmith::Builders::RSpec::Helper

Inherits:
Abstract
  • Object
show all
Defined in:
lib/rubysmith/builders/rspec/helper.rb

Overview

Builds RSpec spec helper for project skeleton.

Instance Method Summary collapse

Methods inherited from Abstract

call, #initialize

Constructor Details

This class inherits a constructor from Rubysmith::Builders::Abstract

Instance Method Details

#callObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/rubysmith/builders/rspec/helper.rb', line 12

def call
  return configuration unless configuration.build_rspec

  builder.call(configuration.merge(template_path: "%project_name%/spec/spec_helper.rb.erb"))
         .render
         .replace(/\A\n/, "")
         .replace("\n\n\n", "\n\n")

  configuration
end