Unit test works 3 times

I am trying to run a single unit test in my rails application, I am using the following command to run the test (say my model are users)

rake test TEST=test/unit/user_test.rb

      

It has a problem, but for some reason it works 3 times, can anyone explain to me why this is the case and if I am doing something wrong above? The next one is my gem. I am using rails. 2.3.2.

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.8.7 (2011-12-28 patchlevel 357) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/sameera/.rvm/gems/ruby-1.8.7-p357
  - RUBY EXECUTABLE: /home/sameera/.rvm/rubies/ruby-1.8.7-p357/bin/ruby
  - EXECUTABLE DIRECTORY: /home/sameera/.rvm/gems/ruby-1.8.7-p357/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/sameera/.rvm/gems/ruby-1.8.7-p357
     - /home/sameera/.rvm/gems/ruby-1.8.7-p357@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

      

Greetings

+3


source to share


1 answer


Annex rails rake test

performed three subtasks, test:units

, test:functionals

, test:integration

.

Each of these tasks runs all tests from the corresponding folder, but your environment variable overrides this search process and the same file is found each time.

You can either do



rake test:units TEST=...

      

or

ruby -I test test/unit/user_test.rb

      

+7


source







All Articles