-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
49 lines (42 loc) · 1.48 KB
/
Rakefile
File metadata and controls
49 lines (42 loc) · 1.48 KB
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
45
46
47
48
49
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
Bakery::Application.load_tasks
# Run specific tests or test files
#
# rake test:blog
# => Runs the full BlogTest unit test
#
# rake test:blog:create
# => Runs the tests matching /create/ in the BlogTest unit test
#
# rake test:blog_controller
# => Runs all tests in the BlogControllerTest functional test
#
# rake test:blog_controller
# => Runs the tests matching /create/ in the BlogControllerTest functional test
rule "" do |t|
# test:file:method
if /test:(.*)(:([^.]+))?$/.match(t.name)
arguments = t.name.split(":")[1..-1]
file_name = arguments.first
test_name = arguments[1..-1]
if File.exist?("test/unit/#{file_name}_test.rb")
run_file_name = "unit/#{file_name}_test.rb"
elsif File.exist?("test/functional/#{file_name}_controller_test.rb")
run_file_name = "functional/#{file_name}_controller_test.rb"
elsif File.exist?("test/functional/#{file_name}_test.rb")
run_file_name = "functional/#{file_name}_test.rb"
end
sh "ruby -Ilib:test test/#{run_file_name} -n /#{test_name}/"
end
end
namespace :sass do
desc 'Updates stylesheets if necessary from their Sass templates.'
task :update => :environment do
Sass::Plugin.update_stylesheets
end
end