rspec-kickstarter 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ require 'rspec_kickstarter'
|
|
10
10
|
|
11
11
|
class RSpecKickstarter::Generator
|
12
12
|
|
13
|
-
attr_accessor :spec_dir, :
|
13
|
+
attr_accessor :spec_dir, :delta_templtae, :full_template
|
14
14
|
|
15
15
|
def initialize(spec_dir = './spec', delta_template = nil, full_template = nil)
|
16
16
|
@spec_dir = spec_dir.gsub(/\/$/, '')
|
@@ -44,9 +44,9 @@ class RSpecKickstarter::Generator
|
|
44
44
|
|
45
45
|
if ! @delta_template.nil?
|
46
46
|
additional_spec = ERB.new(@delta_template, nil, '-', '_additional_spec_code').result(binding)
|
47
|
-
elsif rails_mode &&
|
47
|
+
elsif rails_mode && spec_path.match(/controllers/)
|
48
48
|
additional_spec = ERB.new(RAILS_CONTROLLER_METHODS_PART_TEMPLATE, nil, '-', '_additional_spec_code').result(binding)
|
49
|
-
elsif rails_mode &&
|
49
|
+
elsif rails_mode && spec_path.match(/helpers/)
|
50
50
|
additional_spec = ERB.new(RAILS_HELPER_METHODS_PART_TEMPLATE, nil, '-', '_additional_spec_code').result(binding)
|
51
51
|
else
|
52
52
|
additional_spec = ERB.new(BASIC_METHODS_PART_TEMPLATE, nil, '-', '_additional_spec_code').result(binding)
|