public Method

Kernel.use_test(test_framework)

Used in Merb.root/dependencies.yml Tells merb which testing framework to use. Currently merb supports rspec and test_unit for testing

Example

$ sudo gem install rspec
use_test :rspec # this line goes in dependencies.yml (or use_test :test_unit)
$ ruby script/generate controller MyController # will use the appropriate generator for tests

Source Code

# File merb/core_ext/kernel.rb, line 118
def use_test(test_framework)
  test_framework = test_framework.to_sym
  raise "use_test only supports :rspec and :test_unit currently" unless
    [:rspec, :test_unit].include?(test_framework)
  Merb::GENERATOR_SCOPE.delete(:rspec)
  Merb::GENERATOR_SCOPE.delete(:test_unit)
  Merb::GENERATOR_SCOPE.push(test_framework)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.