Skip to content

Instantly share code, notes, and snippets.

@noelrappin
Created September 19, 2022 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noelrappin/b6242257b1856a5774de959bf9fe0c00 to your computer and use it in GitHub Desktop.
Save noelrappin/b6242257b1856a5774de959bf9fe0c00 to your computer and use it in GitHub Desktop.
class TestClass
extend Quiz::TestCase
def with_a_user
@user = User.new
end
def with_an_admin
@user = User.new(admin: true)
end
test { setup: :with_a_user }
def user_is_not_an_admin
assert_that(@user.admin).is_falsy
end
test { setup: :with_an_admin }
def user_is_an_admin
assert_that(@user.admin).is_truthy
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment