Module: Kernel
- Defined in:
- lib/smartest/dsl.rb
Instance Method Summary collapse
-
#around_suite {|suite| ... } ⇒ void
Register a hook that wraps the whole suite.
-
#around_test {|test| ... } ⇒ void
Register a hook that wraps tests declared after this hook in the same file.
-
#test(name, **metadata) { ... } ⇒ void
Define a named Smartest test.
Instance Method Details
#around_suite {|suite| ... } ⇒ void
This method returns an undefined value.
Register a hook that wraps the whole suite.
The block receives a ‘Smartest::SuiteRun` object and must call `suite.run` exactly once.
|
|
# File 'lib/smartest/dsl.rb', line 68
|
#around_test {|test| ... } ⇒ void
This method returns an undefined value.
Register a hook that wraps tests declared after this hook in the same file.
The block receives a ‘Smartest::TestRun` object and must call `test.run` exactly once. The hook wraps fixture setup, the test body, and fixture teardown.
|
|
# File 'lib/smartest/dsl.rb', line 68
|
#test(name, **metadata) { ... } ⇒ void
This method returns an undefined value.
Define a named Smartest test.
Fixture values are requested with required keyword block parameters:
test("opens the home page") do |page:|
page.goto("/")
end
Smartest installs this method by prepending ‘Smartest::DSL` into Kernel, so it overrides Ruby’s built-in ‘Kernel#test` file-test helper while Smartest tests are being loaded.
|
|
# File 'lib/smartest/dsl.rb', line 68
|