You are here: Browse Railsplugins Simply Bdd
Allows you to use context and specify macros for creating TestCase classes
context “New User” do def setup @user = User.new end end
specify "should be invalid without a username" do
assert !@user.valid?
@user.username = 'someusername'
assert_valid @user
end
This (dynamically) generates a class like:
class NewUserTest < Test::Unit::TestCase def setup @user = User.new end end
def test_should_be_invalid_without_a_username
assert !@user.valid?
@user.username = 'someusername'
assert_valid @user
end
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly