Skip to content

Instantly share code, notes, and snippets.

@latompa
Created August 24, 2009 21:05
Show Gist options
  • Save latompa/174181 to your computer and use it in GitHub Desktop.
Save latompa/174181 to your computer and use it in GitHub Desktop.
#
# In the following test, the setup is supposed to create a variable,
# but fails because of a missing method
#
# If you run this test, you wont see the setup error,
# it's being masked by teardown, because @some_object is nil
#
require 'test/unit'
require 'rubygems'
require 'shoulda'
class NewTest < Test::Unit::TestCase
context "my context" do
setup do
@some_object = get_object
end
context "testing stuff" do
should "do stuff" do
p "doing it"
end
teardown do
@some_object.destroy
end
end
end
en
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment