class Rspec::Generators::Base
@private
Public Class Methods
configuration()
click to toggle source
@private Load configuration from RSpec
to ensure ‘–default-path` is set
# File lib/generators/rspec.rb, line 25 def self.configuration @configuration ||= begin configuration = RSpec.configuration options = RSpec::Core::ConfigurationOptions.new({}) options.configure(configuration) configuration end end
source_root(path = nil)
click to toggle source
# File lib/generators/rspec.rb, line 15 def self.source_root(path = nil) if path @_rspec_source_root = path else @_rspec_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'rspec', generator_name, 'templates')) end end
Public Instance Methods
target_path(*paths)
click to toggle source
# File lib/generators/rspec.rb, line 35 def target_path(*paths) File.join(self.class.configuration.default_path, *paths) end