7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/rspec/rake/example_group.rb', line 7
def self.included(base)
base.instance_eval do
metadata[:type] = :task
metadata[:tasks_path] ||= File.join('../', 'lib', 'tasks')
metadata[:rakefile] ||= nil
subject(:task) { Rake.application[self.class.top_level_description] }
before(:all) do
metadata = self.class.metadata
task_name = self.class.top_level_description
rakefile = metadata[:rakefile] || task_name.split(':').first
task_path = File.join(metadata[:tasks_path], rakefile)
Rake.application = Rake::Application.new
Rake.application.rake_require(task_path, $LOAD_PATH, [])
end
end
end
|