Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my minitest.rake running twice when I enter rake into terminal?

I created a minitest.rake, as per ryan bates railscast (http://railscasts.com/episodes/327-minitest-with-rails).

When I run rake in the terminal, the test runs, and then runs again before resetting the command line.

require "rake/testtask"

Rake::TestTask.new(:test => "db:test:prepare") do |t|
  t.libs << "test"
  t.pattern = "test/**/*_test.rb"
end

task default: :test
like image 749
Brian Petro Avatar asked Mar 06 '13 16:03

Brian Petro


People also ask

What is run Rake?

Rake is a popular task runner for Ruby and Rails applications. For example, Rails provides the predefined Rake tasks for creating databases, running migrations, and performing tests. You can also create custom tasks to automate specific actions - run code analysis tools, backup databases, and so on.

What is a Rake task?

Rake is a software task management and build automation tool created by Jim Weirich. It allows the user to specify tasks and describe dependencies as well as to group tasks in a namespace. It is similar in to SCons and Make.

What is a Rake in Rails?

Rake is Ruby Make, a standalone Ruby utility that replaces the Unix utility 'make', and uses a 'Rakefile' and . rake files to build up a list of tasks. In Rails, Rake is used for common administration tasks, especially sophisticated ones that build off of each other.


1 Answers

I'd suppose you already have a task with such a name defined. If you define a new task with the same name it is appended to already existing one.

What if you remove or comment out this code and do rake -T, will test task be there?

like image 145
khustochka Avatar answered Sep 23 '22 16:09

khustochka