-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_jasmine.rb
44 lines (38 loc) · 1.45 KB
/
_jasmine.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
git_commit "[Jasmine] Bundle jasmine gem" do
gem 'jasmine', :group => [:development, :test]
bundle :install
end
git_commit "[Jasmine] jasmine init" do
run 'jasmine init'
remove_file 'public/javascripts/Player.js'
remove_file 'public/javascripts/Song.js'
remove_file 'spec/javascripts/PlayerSpec.js'
end
git_commit "[Jasmine] Configure jasmine for our JavaScripts" do
replace_file 'spec/javascripts/support/jasmine.yml', :method => :template
end
git_commit "[Jasmine] Disable jasmine rake tasks for production" do
gsub_file 'lib/tasks/jasmine.rake', /^/, " "
prepend_file 'lib/tasks/jasmine.rake', "unless Rails.env == 'production'\n"
append_file 'lib/tasks/jasmine.rake', "end\n"
end
git_commit "[Jasmine] Add jasmine-jquery extension" do
install_file 'spec/javascripts/helpers/jasmine-jquery-1.1.3.js'
end
git_commit "[Jasmine] Add JavaScript fixture builder support" do
append_file '.gitignore', "\n/spec/javascripts/fixtures"
install_file 'spec/support/js_fixture_builder.rb'
insert_into_file 'spec/spec_helper.rb', :before => "\nend" do
"\n config.include JsFixtureBuilder"
end
javascripts_partial = 'app/views/layouts/_javascripts.html.haml'
gsub_file javascripts_partial, /^/, ' '
prepend_file javascripts_partial, "#load-javascripts\n"
end
git_commit "[Jasmine] Add Jasmine tests to CI build" do
insert_into_file 'lib/tasks/ci.rake', :before => /^end/ do
<<-EOF
Rake::Task['jasmine:ci'].invoke
EOF
end
end