Class: Rambo::RSpec::Examples
- Inherits:
-
Object
- Object
- Rambo::RSpec::Examples
- Defined in:
- lib/rambo/rspec/examples.rb
Instance Attribute Summary collapse
-
#examples ⇒ Object
readonly
Returns the value of attribute examples.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#raml ⇒ Object
readonly
Returns the value of attribute raml.
-
#resources ⇒ Object
readonly
Returns the value of attribute resources.
Instance Method Summary collapse
- #compose ⇒ Object
- #example_groups ⇒ Object
- #generate! ⇒ Object
-
#initialize(raml, options = nil) ⇒ Examples
constructor
A new instance of Examples.
Constructor Details
#initialize(raml, options = nil) ⇒ Examples
Returns a new instance of Examples.
8 9 10 11 |
# File 'lib/rambo/rspec/examples.rb', line 8 def initialize(raml, =nil) @raml = raml = end |
Instance Attribute Details
#examples ⇒ Object (readonly)
Returns the value of attribute examples.
6 7 8 |
# File 'lib/rambo/rspec/examples.rb', line 6 def examples @examples end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/rambo/rspec/examples.rb', line 6 def end |
#raml ⇒ Object (readonly)
Returns the value of attribute raml.
6 7 8 |
# File 'lib/rambo/rspec/examples.rb', line 6 def raml @raml end |
#resources ⇒ Object (readonly)
Returns the value of attribute resources.
6 7 8 |
# File 'lib/rambo/rspec/examples.rb', line 6 def resources @resources end |
Instance Method Details
#compose ⇒ Object
13 14 15 16 17 |
# File 'lib/rambo/rspec/examples.rb', line 13 def compose return '' unless examples examples.join("\n\n") end |
#example_groups ⇒ Object
23 24 25 |
# File 'lib/rambo/rspec/examples.rb', line 23 def example_groups @example_groups ||= resources.map {|r| ExampleGroup.new(r, ) } end |
#generate! ⇒ Object
27 28 29 |
# File 'lib/rambo/rspec/examples.rb', line 27 def generate! @examples = example_groups.map(&:render) end |