Module: Easytest::DSL
- Defined in:
- lib/easytest/dsl.rb
Instance Method Summary collapse
- #after(&block) ⇒ Object
- #before(&block) ⇒ Object
- #expect(actual = nil) ⇒ Object
- #only(name, &block) ⇒ Object
- #skip(name, &block) ⇒ Object
- #test(name, &block) ⇒ Object
Instance Method Details
#after(&block) ⇒ Object
12 13 14 |
# File 'lib/easytest/dsl.rb', line 12 def after(&block) Easytest.add_hook Hook.new(type: :after, block: block) end |
#before(&block) ⇒ Object
8 9 10 |
# File 'lib/easytest/dsl.rb', line 8 def before(&block) Easytest.add_hook Hook.new(type: :before, block: block) end |
#expect(actual = nil) ⇒ Object
26 27 28 |
# File 'lib/easytest/dsl.rb', line 26 def expect(actual = nil, &) Expectation.new(actual, &) end |
#only(name, &block) ⇒ Object
21 22 23 24 |
# File 'lib/easytest/dsl.rb', line 21 def only(name, &block) Utils.raise_if_no_test_name(name, method: "only") Easytest.add_case Case.new(name: name, only: true, block: block) end |