25 Apr '13, 6am

Fighting test pollution with an RSpec custom ordering strategy via @pivotallabs

Test pollution manifests itself as seemingly false negatives or false positives in a test suite. It occurs when some shared state is unintentionally modified, or unintentionally read and used in a test. When test pollution builds up, it can mean that a project’s build fails unpredictably, which can stop a whole team from shipping code regularly. This is an expensive way to not build software. Here’s an example of test pollution. You can save and run it with Ruby if you like. You shouldn’t need anything but a recent version of Ruby. If you run it several times, it will sometimes fail and sometimes pass: require 'minitest/autorun' class User def self.login(username, password) if username == 'fred' && password == '123' @logged_in = true end end def self.logged_in? @logged_in == true end end class UserTest < MiniTest::Unit::TestCase def test_logs_in_if_correct_credentials_used...

Full article: http://pivotallabs.com/find-test-pollution-rspec/

Tweets

test

inforum.in 05 May '13, 8am

Domain AVONC.COM is available for sale now at sedo.com. In case you have any questions, please contact me by email alex.ge...

How to Create a Mobile Content Strategy

searchenginewatch.com 26 Apr '13, 11am

Content strategy is all about matching visitor intent with the right message to meet user needs and business goals simulta...

Pairing like a Pivot via @pivotallabs

pivotallabs.com 26 Apr '13, 7pm

Pairing is an amazing activity if you and your pair can do it right, it is one of the things we value most here at Pivotal...

Everyday Rails Testing with RSpec: Updates for ...

everydayrails.com 25 Apr '13, 2am

Everyday Rails Testing with RSpec: Updates for April, 2013 April 24, 2013 Last week I released another round of updates to...

#Solar Plane Makes Last Test Flight Before ‘Acr...

seia.org 26 Apr '13, 3pm

The Solar Impulse solar-powered airplane made history in 2010 when it embarked on the first-ever solar-powered night fligh...