Class: FactoryBot::Blueprint::RSpec::Letbp
- Inherits:
-
Object
- Object
- FactoryBot::Blueprint::RSpec::Letbp
- Defined in:
- lib/factory_bot/blueprint/rspec/letbp.rb
Overview
An intermediate object for letbp
syntax. See Driver#letbp for more details.
Instance Method Summary collapse
-
#build { ... } ⇒ Object
Create a new blueprint, and create a set of objects (with
build
build strategy) from it. -
#build_from { ... } ⇒ Object
Create a set of objects (with
build
build strategy) from an existing blueprint. -
#build_stubbed { ... } ⇒ Object
Create a new blueprint, and create a set of objects (with
build_stubbed
build strategy) from it. -
#build_stubbed_from { ... } ⇒ Object
Create a set of objects (with
build_stubbed
build strategy) from an existing blueprint. -
#create { ... } ⇒ Object
Create a new blueprint, and create a set of objects (with
create
build strategy) from it. -
#create_from { ... } ⇒ Object
Create a set of objects (with
create
build strategy) from an existing blueprint. -
#inherit { ... } ⇒ Object
Extend
super()
blueprint.
Instance Method Details
#build { ... } ⇒ Object
Create a new blueprint, and create a set of objects (with build
build strategy) from it.
37 38 39 40 41 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 37 def build(&) let_blueprint(:new, &) let_instance(:build) let_objects end |
#build_from { ... } ⇒ Object
Create a set of objects (with build
build strategy) from an existing blueprint.
72 73 74 75 76 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 72 def build_from(&) let_blueprint(:from, &) let_instance(:build) let_objects end |
#build_stubbed { ... } ⇒ Object
Create a new blueprint, and create a set of objects (with build_stubbed
build strategy) from it.
45 46 47 48 49 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 45 def build_stubbed(&) let_blueprint(:new, &) let_instance(:build_stubbed) let_objects end |
#build_stubbed_from { ... } ⇒ Object
Create a set of objects (with build_stubbed
build strategy) from an existing blueprint.
80 81 82 83 84 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 80 def build_stubbed_from(&) let_blueprint(:from, &) let_instance(:build_stubbed) let_objects end |
#create { ... } ⇒ Object
Create a new blueprint, and create a set of objects (with create
build strategy) from it.
53 54 55 56 57 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 53 def create(&) let_blueprint(:new, &) let_instance(:create) let_objects end |
#create_from { ... } ⇒ Object
Create a set of objects (with create
build strategy) from an existing blueprint.
88 89 90 91 92 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 88 def create_from(&) let_blueprint(:from, &) let_instance(:create) let_objects end |
#inherit { ... } ⇒ Object
Extend super()
blueprint.
112 113 114 115 116 |
# File 'lib/factory_bot/blueprint/rspec/letbp.rb', line 112 def inherit(&) let_blueprint(:inherit, &) # We don't need `let_instance` here because it's already defined in the parent context let_objects end |