testunit Questions
3
Solved
Can you execute assert_equal from within irb? This does not work.
require 'test/unit'
assert_equal(5,5)
4
Solved
I'm trying to include the unit tests for a module in the same source file as the module itself, following the Perl modulino model.
#! /usr/bin/env ruby
require 'test/unit'
module Modulino
def m...
Berrie asked 1/12, 2009 at 16:2
10
I'm struggling with Test::Unit. When I think of unit tests, I think of one simple test per file. But in Ruby's framework, I must instead write:
class MyTest < Test::Unit::TestCase
def setup ...
Recto asked 1/11, 2008 at 19:8
3
Solved
I am trying to use both Capybara and Cucumber in my Rails application. So, that's what i did:
Installed gems needed and added them to the Gemfile
Ran the rails generate capybara:install --cucumbe...
Feast asked 29/8, 2012 at 11:28
3
Solved
I have guard-spork running on my rails 3.2.11 project on Ubuntu 12.04.
I got my configuration from railstutorial.org.
Spork starts, then guard says it can't find spork to start, waits 30 secs, th...
Merriment asked 9/2, 2013 at 21:46
4
Solved
I often run the various test groups like:
rake test:units
rake test:functionals
I also like to run individual test files or individual tests:
ruby -Itest test/unit/file_test.rb
ruby -Itest test...
Passible asked 11/7, 2011 at 21:37
1
Solved
If I create a new Rails (3.2.12) app. Add the test-unit gem to my development, test group, and then scaffolded resource. When I run the tests from the Mac console.app, I get color output.
bundle e...
Teleplay asked 22/2, 2013 at 16:44
2
Solved
In Java typically you would create two source folders src and test with an identical package hierarchy.
In Ruby do you just put all the tests in the same folder as the class under test? Or do you ...
Pazpaza asked 20/11, 2011 at 15:26
1
Solved
In my Rails 3 app, I've been using jQuery's attr() method to do things like this:
$('#application_dust_type_id').attr('disabled', 'disabled');
I would use Test/Unit, capybara and capybara-webkit...
Osithe asked 19/12, 2012 at 14:25
2
Solved
I read somewhere that 'minitest' is the "new test::unit for ruby 1.9.2+".
But ruby 1.9.3 seems to include both test::unit and minitest, is that true?
In the default rails testing, as outlined in...
Endopeptidase asked 13/5, 2012 at 17:53
1
Rake is too verbose:
$ bundle exec rake test:units
/Users/jared/.rvm/rubies/ruby-1.8.7-p370/bin/ruby -I"lib:test" -I"/Users/jared/.rvm/gems/ruby-1.8.7-p370@global/gems/rake-0.9.2.2/lib" "/Users/ja...
1
I'm looking for a way to test methods that use File class with test_unit.
It's really the same thing that issue with Rspec but how to make it work with test_unit.
def foo
File.open "filename", "w...
3
Solved
I have 4 tests in one ruby script, which I run using command
ruby test.rb
the out put looks like
Loaded suite test
Started
....
Finished in 50.326546 seconds.
4 tests, 5 assertions, 0 failures, ...
Explicit asked 11/5, 2012 at 17:56
2
Solved
I am testing some Ruby code and have a failing Test::Unit::TestCase. Unfortunately, the failure report only gives me the top error, not a full stack trace. Specifically, it says:
1) Failure:
test...
6
Solved
I'm beginning the planning phase of creating a testing suite for my rails 3.0.8 application. I'm trying to decide on which testing framework/gems to use. Normally I prefer to stick to Rails convent...
Gerda asked 17/6, 2011 at 6:53
1
Solved
We're developing an app on Ruby 1.9.3 and Rails 3.2.1.
Recently, our unit tests have become sluggish at the beginning. It takes ~15 seconds for the invocations & executions to take place. Once...
Coating asked 27/5, 2012 at 1:27
1
Solved
i have two question
1.How do i stub a nil object in rails test cases.
2.Mock an Active Record Abstract class
I have a application X with a test database X_test, Now i need to
stub an database ...
Forbidding asked 9/3, 2012 at 11:55
1
Solved
Rails 3.2.1 app, using the minitest and autotest-rails gems.
If I run "rake test" the output is in color. But if I run autotest, the output is not in color.
How can I get color output when using...
Reseda asked 21/2, 2012 at 20:54
1
Solved
Assume there are potentially expensive operations to be performed in setup or teardown that are same for all tests and whose results doesn't get messed with during test runs. It seems not right to ...
Catholic asked 2/2, 2012 at 20:21
2
Ruby test unit gem doesn't show dots for passed test. I'm running on Ubuntu 11.04 .
It shows 'E' and 'F' for failure, but nothing for pass. This problem dissapears if I comment gem 'test-unit' li...
2
Solved
I call a third party web service right now as part of my application. I am using the RestClient gem in order to do this. There are a ton of tools available to do the same thing, so that should not ...
Marquise asked 24/10, 2011 at 22:51
2
Solved
Instead of running all the test cases automatically, is there any way to execute a single test under ruby test/unit framework. I know I can achieve that by using Rake but I am not ready to switch t...
Paraffin asked 29/6, 2011 at 3:4
2
Solved
I am using Ruby 1.9.2 (ruby -v yields :ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]), and I am trying to get this to work:
require 'test/unit'
class TestStartup < Test::Unit::Tes...
13
Solved
I'm trying to set up Factory Girl with Test::Unit and Shoulda in Ruby on Rails. I have installed the gem, created my factory file under the test/factories directory, and created my spec file under ...
Amor asked 21/7, 2009 at 15:38
1
What's a good method for unit testing which test a script's ability to maintain correct data between executions--after a script is terminated with Ctrl-C and then re-run? Are there any tests for ex...
© 2022 - 2024 — McMap. All rights reserved.