Merb Wiki
Home
All Pages
New Page
Editing Test/Unit
Textile Enabled
| [[Page Name]] for internal links
I found Rake::TestTask incompatible with Merb - creating such a task wouldn't load whole Merb environment, even if it was invoked from a task that had prerequisite :merb_env. The below task should work correctly, remember to add this line to test/test_helper.rb: <pre><code class="ruby"> include Merb::Test::RequestHelper </code></pre> Rakefile <pre><code class="ruby"> desc "Run all tests (TASK=regexp to run specific files only)" task :test => :merb_env do only = ENV['TASK'] test_files = FileList[File.join('test', '**', '*_test.rb')] test_files = test_files.select { |path| path =~ Regexp.new(only) } if only test_files.each { |f| require f } end </code></pre> By default, rake tasks are run in a special environment called 'rake'. You may wish to run the above test task as follows: <pre><code> rake test MERB_ENV=test </code></pre>
Submit
Recent Activity
Home
was updated
Home
was updated
deploying-a-merb-application-to-a-jee-container-us
was updated
deploying-a-merb-application-to-a-jee-container-us
was updated
Merb Developers available for work
was updated
deploying-a-merb-application-to-a-jee-container-us
was updated
deploying-a-merb-application-to-a-jee-container-us
was updated
deploying-a-merb-application-to-a-jee-container-us
was updated
deploying-a-merb-application-to-a-jee-container-us
was updated
Home
was updated