TConsole in Rails 4
Controller's tests is at test/controllers directory in Rails 4 project, but in Rails 3.* tests is at test/functional. TConsole doesn't detect tests in Rails 4 with message:
No test files match your requested test set: test/unit/**/*_test.rb,test/functional/**/*_test.rb,test/integration/**/*_test.rb.
Skipping execution.
You should create configuration file .tconsole in root project directory and put such configs:
TConsole::Config.run do |config|
# File sets are the named sets of files that can be executed. A file
# set named "all" must be included.
config.file_sets = {
"all" => ["test/**/*_test.rb"]
}
# Specifies code to be run before each test execution
config.before_test_run do
puts "RUN WITH CONFIG FOR RAILS 4!!!"
end
end
Now TConsole detect your tests in test/controllers and you have message in console that TConsole is running with configs.
Written by Павел Калашников
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#