Class: TestBench::Fixture::Evaluate
- Inherits:
-
Object
- Object
- TestBench::Fixture::Evaluate
- Includes:
- TestBench::Fixture
- Defined in:
- lib/test_bench/fixture/evaluate.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Attributes included from TestBench::Fixture
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(block) ⇒ Evaluate
constructor
A new instance of Evaluate.
Methods included from TestBench::Fixture
#assert, #assert_raises, #comment, comment, #context, #context!, #detail, #fail!, #fixture, #fixture_passed?, output, #refute, #refute_raises, #test, #test!
Constructor Details
#initialize(block) ⇒ Evaluate
Returns a new instance of Evaluate.
8 9 10 |
# File 'lib/test_bench/fixture/evaluate.rb', line 8 def initialize(block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/test_bench/fixture/evaluate.rb', line 6 def block @block end |
Class Method Details
.build(session:, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/test_bench/fixture/evaluate.rb', line 12 def self.build(session:, &block) instance = new(block) Session.configure(instance, session:, attr_name: :test_session) instance end |
.call(session: nil, &block) ⇒ Object
18 19 20 21 22 |
# File 'lib/test_bench/fixture/evaluate.rb', line 18 def self.call(session: nil, &block) instance = build(session:, &block) instance.() instance end |
Instance Method Details
#call ⇒ Object
24 25 26 |
# File 'lib/test_bench/fixture/evaluate.rb', line 24 def call instance_exec(&block) end |