Using Ruby 1.8.6, stubbing a finder method to return an Array does not work when the code under test calls the 'count' method on the result:
User.any_instance.stubs(:friends).returns([user1, user2])
That's because Array.count has only been added in Ruby 1.8.7. Rails also adds a count method dynamically, I believe through the ActiveRec...
So I know in ruby that x.nil? will test if x is null.
What is the simplest way to test if x equals ' ', or ' '(two spaces), or ' '(three spaces), etc?
Basically, I'm wondering what the best way to test if a variable is all whitespace?
...
Is it better to write/record selenium tests in html format and run them directly in the server with "-htmlSuite" or to write the tests in java/C#/... and run them in the server using selenium-rc?
What is the recommended solution?
...
I'm still new to Unit testing, and specifically PHPUnit as the testing framework.
Suppose I'm building a unit test for a resource loader class. The class looks for resources to load in two directories (a global and a user-specific one).
To test the class, I would like to set up a mock testing directory containing some resource files. I...
In order to have the fast speed of website, the web sever compress (gzip) the html files before sending to our clients.
When running selenium tests, it shows a pop-up saying:
You have chosen to open
...
which is a: Bin file
from: http://...
Would you like to save this file?
"Cancel" "Save File"
It seems that the compressed html file...
In the last two companies I've been at, I have found an overriding mentality among developers that it's okay to write unit tests in a throw-away style. Code that they would never write in the actual product suddenly becomes OK in the unit tests. I'm talking
Rampant copying and pasting between tests
Code styling rules not followed
Har...
I am performance integration testing where I fire up the ASPX pages using WatiN and fill the fields and insert into the database. There are couple of problems that I am facing.
1) Should I use a completely separate database for integration testing? I already gave db_test and db_dev. db_test is for unit testing and is cleared after each...
Does anyone know of any good resources (books, articles, existing software, etc...) for learning how to implement A/B split testing in ASP.NET?
...
I've realized I need a full-fledged browser automation tool for testing user interactions with our JavaScript widget library. I was using qunit, starting with unit testing and then I unwisely started incorporating more and more functional tests. That was a bad idea: trying to simulate a lot of user actions with JavaScript. The timing iss...
In my current company, we have one tester. Having spoken to this tester, she says that in testing, before implementing any automation systems, the scripts (steps to take) are manually written and performed (performed at least once).
Is this the way things work in testing?
To make me laugh, this has been done in this case, yet no automa...
If I browse to a flex application when recording with VS Test, I can see the calls to WebORB (amf calls). However, when stopping the recording this is what happens:
First, Visual Studio detects dynamic parameters, but stays around 20%, and never gets through it.
Second, if I cancel the detecting dynamic parameters, and run the web test...
In the past it has been a real PITA to unit test custom Code Analysis rules. I haven't found anything out there that shows the situation to be any different in 2010, but I'm not giving up. If anyone knows if this is "possible" in 2010 please respond - thanks!
...
I have a service that accepts Xmla queries for Analysis services, often times those queries themselves will have a string that contains a fragment that looks something like
{{[Time].[Year].[All]}}
Recording these requests works fine but when I try to re-run the test I get an error from the test runner...
Request failed: Exception oc...
I'm not sure what I've done wrong in my CakePHP unit test configuration. Every time I run a test case, the model tables associated with my fixtures are missing form my test database.
After running an individual test case I have to re-import my database tables using phpMyAdmin.
Here are the relevant files:
This is the class I'm trying ...
I have problem concerning python packages and testing. I'm writing an application using wx python and have the following basic folder/package structure for the gui parts. The mainframe.py window has a dependency to the logpane.py panel, which is easily imported using an absolute import in mainframe.py:
import guiapp.utilviews.logpane
...
On my Windows machine -- I typically test different versions of Internet Explorer using an array of Virtual Machine instances (which obviously requires a fair amount of investment in time and money). In a pinch I have also used IETester -- which at times can be a little unreliable.
However, I just discovered IE Collection and was wonde...
Greetings,
I'm fairly new to TDD and ran across a unit test that I'm not entirely sure how to address.
Basically, I'm testing a couple of legacy class methods which read/write a binary stream to a file. The class functions take a serializable object as a parameter, which handles the actual reading/writing to the file.
For testing this...
Hi Folks,
We have a software house developing code for us on a project, .NET Web Service (WCF) and we are also paying for a test harness to be built as a separate billable task on a daily rate. I have just joined the company and am reviewing what we are getting from the software house and wanted to know what you guys in industry thought...
I want to test a script I have written in Perl and specifically check what output it writes to file. I wrote it some time ago and don't want to modify it to the extent of turning it into a module but would like to regression test it before adding some small functional changes.
So far I have
use Test::Command tests => 10;
exit_is_num($...
Is it possible to run JUnit tests from inside my java application?
Are there test frameworks I can use (such as JUnit.jar?), or am I force to find the test files, invoke the methods and track the exceptions myself?
The reason why I am asking is my application requires a lot of work to start launch (lots of dependencies and configuratio...