forked from manveru/ramaze
-
Notifications
You must be signed in to change notification settings - Fork 37
Running a single test
Michel Blanc edited this page Aug 11, 2012
·
1 revision
When writing tests, it's not convenient to run the whole suite to see if it pass or not. If you set-up your test suite properly, requiring the right files in each spec file, you can make is easy to run running a single spec file.
For instance, you can crete a helper.rb
file in specs/
like this :
require 'ramaze'
require 'ramaze/spec/bacon'
# Require you main app.rb file
# Even if you run your whole test suite, it will only be required one
require File.expand_path('../../app', __FILE__)
puts "Running specs using database #{DB.opts[:database]}\n"
Then, in each spec file, add (ruby 1.9.3+) :
require_relative './helper'
You can then execute your spec directly :
ruby myspec.rb
- Website
- Google Groups
- User Guide
- [#ramaze on the Freenode network] (http://webchat.freenode.net/?channels=ramaze)