lib/rails-talks/runner.rb in rails-talks-0.0.2 vs lib/rails-talks/runner.rb in rails-talks-0.0.3
- old
+ new
@@ -1,12 +1,18 @@
module RailsTalks
module Runner
class << self
def run_tests(opts)
- Talks.info 'Rails tests started'
- system "bundle exec rake test #{opts[1..-1].join(' ')}"
- Talks.info 'Rails tests ended'
+ run_rake(opts, 'Rails tests started', 'Rails tests ended')
+ end
+
+ def run_rake(opts, before = nil, after = nil)
+ before ||= "Rake task '#{opts[0]}' started"
+ after ||= "Rake task '#{opts[0]}' ended"
+ Talks.info before
+ system "bundle exec rake #{opts[0..-1]}"
+ Talks.info after
end
end
end
end