Module: Assert::RakeTasks
- Includes:
- Rake::DSL
- Defined in:
- lib/assert/rake_tasks.rb,
lib/assert/rake_tasks.rb,
lib/assert/rake_tasks/irb.rb,
lib/assert/rake_tasks/scope.rb,
lib/assert/rake_tasks/test_task.rb
Defined Under Namespace
Classes: Irb, Scope, TestTask
Constant Summary
collapse
- FILE_SUFFIX =
"_test.rb"
Class Method Summary
collapse
Class Method Details
.for(test_root = 'test') ⇒ Object
.included(receiver) ⇒ Object
Setup the rake tasks for testing
16
17
18
19
|
# File 'lib/assert/rake_tasks.rb', line 16
def self.included(receiver)
self.for('test') if File.exists?(File.expand_path('./test', Dir.pwd))
end
|
.irb_task(irb) ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/assert/rake_tasks.rb', line 29
def irb_task(irb)
if irb.helper_exists?
desc irb.description
task irb.class.task_name do
sh irb.cmd
end
end
end
|
.to_tasks(scope) ⇒ Object
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/assert/rake_tasks.rb', line 38
def to_tasks(scope)
if (scope_tt = scope.to_test_task)
desc scope_tt.description
task scope_tt.name do
RakeFileUtils.verbose(scope_tt.show_loaded_files?) { ruby scope_tt.ruby_args }
end
end
namespace scope.namespace do
scope.test_tasks.each do |test_file_tt|
desc test_file_tt.description
task test_file_tt.name do
RakeFileUtils.verbose(test_file_tt.show_loaded_files?) { ruby test_file_tt.ruby_args }
end
end
scope.scopes.each do |sub_scope|
self.to_tasks(sub_scope)
end
end
end
|