Class: RSpec::Manumit::ProjectInitializer

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/manumit/project_initializer.rb

Constant Summary collapse

MANUMIT_HELPER_FILE =
'spec/manumit_helper.rb'
FEATURE_SPEC_FILE =
'spec/features/homepage_spec.rb'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeProjectInitializer

Returns a new instance of ProjectInitializer.



10
11
12
13
14
# File 'lib/rspec/manumit/project_initializer.rb', line 10

def initialize
  @destination = Dir.getwd
  @stream = $stdout
  @template_path = File.expand_path('../project_initializer', __FILE__)
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



5
6
7
# File 'lib/rspec/manumit/project_initializer.rb', line 5

def destination
  @destination
end

#streamObject (readonly)

Returns the value of attribute stream.



5
6
7
# File 'lib/rspec/manumit/project_initializer.rb', line 5

def stream
  @stream
end

#template_pathObject (readonly)

Returns the value of attribute template_path.



5
6
7
# File 'lib/rspec/manumit/project_initializer.rb', line 5

def template_path
  @template_path
end

Instance Method Details

#runObject



16
17
18
19
20
# File 'lib/rspec/manumit/project_initializer.rb', line 16

def run
  system('rspec --init')
  copy_template MANUMIT_HELPER_FILE
  copy_template FEATURE_SPEC_FILE
end