Module: DNApi::Test::Ext
- Included in:
- Struct
- Defined in:
- lib/dnapi/test/ext.rb
Instance Method Summary collapse
- #default_fauxture_name ⇒ Object
- #fixture(name = default_fauxture_name, &blk) ⇒ Object (also: #fix)
- #generate(name = default_fauxture_name, attributes = {}) ⇒ Object (also: #gen)
- #generate_attributes(name = default_fauxture_name) ⇒ Object (also: #gen_attrs)
- #pick(name = default_fauxture_name) ⇒ Object
Instance Method Details
#default_fauxture_name ⇒ Object
27 28 29 |
# File 'lib/dnapi/test/ext.rb', line 27 def default_fauxture_name :default end |
#fixture(name = default_fauxture_name, &blk) ⇒ Object Also known as: fix
4 5 6 |
# File 'lib/dnapi/test/ext.rb', line 4 def fixture(name = default_fauxture_name, &blk) Sweatshop.add(self, name, &blk) end |
#generate(name = default_fauxture_name, attributes = {}) ⇒ Object Also known as: gen
10 11 12 13 |
# File 'lib/dnapi/test/ext.rb', line 10 def generate(name = default_fauxture_name, attributes = {}) name, attributes = default_fauxture_name, name if name.is_a? Hash Sweatshop.make(self, name, attributes) end |
#generate_attributes(name = default_fauxture_name) ⇒ Object Also known as: gen_attrs
17 18 19 |
# File 'lib/dnapi/test/ext.rb', line 17 def generate_attributes(name = default_fauxture_name) Sweatshop.attributes(self, name) end |