Questions tagged [testunit]

Test-unit is a unit testing library in Ruby. It was part of the standard library in Ruby 1.8, and there's a compatibility layer in the standard library of Ruby 1.9.

Test-unit is a unit testing library in Ruby. It was part of the standard library in Ruby 1.8, and there's a compatibility layer in the standard library of Ruby 1.9.

Test::Unit (test-unit) is unit testing framework for Ruby, based on xUnit principles. These were originally designed by Kent Beck, creator of extreme programming software development methodology, for Smalltalk's SUnit. It allows writing tests, checking results and automated testing in Ruby.

366 questions
0
votes
2 answers

Object.respond_to? fails when retrieving method name symbol from array

I'm implementing page objects, and writing tests to verify them. I want to simplify the tests by storing the element names in an array of symbols and looping through it, but it's failing. def setup @browser = Watir::Browser.new :phantomjs …
Rogue_Leader
  • 212
  • 3
  • 14
0
votes
1 answer

Why am I getting a NoMethodError when I use Mocha 0.9.8 with Test::Unit 2.1.1

Has anyone seen this? Here's the error: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -rrubygems -e "require 'redgreen'" -I.:lib:test -rubygems -e "['test/unit', 'test/test_authentication.rb'].each { |f| require f }" |…
AndrewVos
  • 1,297
  • 2
  • 14
  • 25
0
votes
0 answers

Is there logging statements available for rake test in test-unit using ruby

I am running rake test in ruby. When I run rake test, I get the following output rake TEST=test_cases/test.rb /home/ubuntu/.rvm/rubies/ruby-2.0.0-p247/bin/ruby -I"helpers" -I"/home/ubuntu/.rvm/gems/ruby-2.0.0-p247@test/gems/rake-10.1.0/lib"…
Galet
  • 5,853
  • 21
  • 82
  • 148
0
votes
2 answers

Multiple users in a rails integration test

I am looking how to do an integration for a flow that requires 2 users, in which you cannot JUMP around in the order. User A does 1 User B does 2 User A does 3 User B does 4 User A does 5 ... Test code is executed in a random order therefor; I…
Daniel
  • 7,006
  • 7
  • 43
  • 49
0
votes
2 answers

Ruby unit test add a test suite to an already existing test suite

I have a test suite with me. I want to add another test class with a set of tests in the test suite. Since this is a class with test cases, I do not know how to add it to the test suite. testsuite - existing test suite. FactorTest.rb - test class…
user384070
  • 81
  • 2
  • 2
  • 9
0
votes
0 answers

How to terminate ruby unit test with "Pass" or success status

First of all thank you very much for reading this question. I am using Ruby-1.8.7 and Webdriver to connect to FF browser. I am testing our product functionality. There is a form and I am giving wrong input and expecting error message. This is 5…
0
votes
1 answer

Ruby unit test :run a test class from the main class

In Ruby unit testing can I run a test class from another class for exa class Foo < Test::Unit:: TestCase test_abc() test_bnd() Now i want to run this above test suite from my main class so how could i do it I tried using runner but dono wat…
user384070
  • 81
  • 2
  • 2
  • 9
0
votes
1 answer

What type should the argument be for the run method in testcase.rb?

For the run(result) method in test/unit/testcase.rb, what attribute type should my result be? It will store the result from the error and assertions from the TestCase class. I don't know if it should be TestCase object or something.
user384070
  • 81
  • 2
  • 2
  • 9
0
votes
1 answer

TeamCity does not catch failing tests in minitest

I have TeamCity up and running in a mac environment. A trigger is also setup to to run a rake task containing a number of test cases on every git commit. The rake command successfully pulls the code and runs the test cases. The passing test cases…
Mehdi Karamnejad
  • 144
  • 2
  • 11
0
votes
1 answer

Formatting console output from Test::Unit

require "json" require "selenium-webdriver" gem "test-unit" require "test/unit" class Tests < Test::Unit::TestCase $out_file = File.new('log.txt', 'w') def $stdout.write string $out_file.write string super end When I use the above code the…
Jen
  • 109
  • 1
  • 12
0
votes
1 answer

Load Error in file when running with minitest

I'm somewhat new to Ruby so I apologize if this is a stupid question. I've searched pretty hard, and can't really find anything that works. My issue, I am trying to unit test a framework i'm writing that is located in the lib directory of a rails…
QPSK
  • 17
  • 4
0
votes
1 answer

Clearance with Test::Unit

I am using Clearance for authentication with my rails app which works. But now all my unit tests fail because they redirect to the sign in page, which makes sense. Clearance seems to have helper functions for fixing that but I can only find them…
Joshua
  • 2,079
  • 20
  • 29
0
votes
1 answer

Jruby + Testunit + Capybara

I'm working with Jruby 1.6.8 and Rails 3.1 doing tests with TestUnit and Capybara and after doing some tests, I started seeing "Errors running test:single! ". It happened to me sometime but after launching tests again it was fixed. I'm launching…
jmolina
  • 259
  • 3
  • 12
0
votes
1 answer

How to define Ruby Test::Unit testcase with `must`

I had a test case of the following form: require 'test/unit' class SomeTests < Test::Unit::TestCase def test_should_do_action assert true end end and have re-written it using must as suggested in the book A Test::Unit Trick to Know…
Plastikfan
  • 3,674
  • 7
  • 39
  • 54
0
votes
2 answers

Getting UrlGenerationErrorr when trying to run test

1) Error: SummariesControllerTest#test_should_get_edit: ActionController::UrlGenerationError: No route matches {:action=>"edit", :controller=>"summaries", :summary=>"298486374", :summary_id=>"298486374"} …
Javier Perez
  • 1,855
  • 1
  • 11
  • 8