Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use a template for multi-line strings

  • Loading branch information...
commit 5270a727c81191b32c8a96c15c1688c009e1a5b7 1 parent 2787281
@croaky croaky authored
View
12 lib/suspenders/app_builder.rb
@@ -25,9 +25,7 @@ def enable_factory_girl_syntax
def test_factories_first
copy_file 'factories_spec.rb', 'spec/models/factories_spec.rb'
- append_file 'Rakefile' do
- "\ndesc 'Run factory specs.'\nRSpec::Core::RakeTask.new(:factory_specs) do |t|\nt.pattern = './spec/models/factories_spec.rb'\nend\n\ntask spec: :factory_specs\n"
- end
+ append_file 'Rakefile', factories_spec_rake_task
end
def setup_staging_environment
@@ -85,7 +83,7 @@ def set_ruby_to_version_being_used
end
def add_custom_gems
- additions_path = find_in_source_paths 'Gemfile_additions'
+ additions_path = find_in_source_paths('Gemfile_additions')
new_gems = File.open(additions_path).read
inject_into_file 'Gemfile', "\n#{new_gems}",
:after => /gem 'jquery-rails'/
@@ -276,8 +274,12 @@ def override_path_for_tests
end
end
+ def factories_spec_rake_task
+ IO.read find_in_source_paths('factories_spec_rake_task.rb')
+ end
+
def simplecov_init
- IO.read(find_in_source_paths('simplecov_init.rb'))
+ IO.read find_in_source_paths('simplecov_init.rb')
end
end
end
View
9 templates/factories_spec_rake_task.rb
@@ -0,0 +1,9 @@
+
+if defined?(RSpec)
+ desc 'Run factory specs.'
+ RSpec::Core::RakeTask.new(:factory_specs) do |t|
+ t.pattern = './spec/models/factories_spec.rb'
+ end
+
+ task spec: :factory_specs
+end
Please sign in to comment.
Something went wrong with that request. Please try again.