Sha256: 865776c1fbcd873d5e1d727bede967f1d50e72fe84f3f94ba7c049d87b962270

Contents?: true

Size: 618 Bytes

Versions: 13

Compression:

Stored size: 618 Bytes

Contents

require "rambo/rspec/example_group"

module Rambo
  module RSpec
    class Examples
      attr_reader :raml, :resources, :examples, :options

      def initialize(raml, options=nil)
        @raml    = raml
        @options = options
      end

      def compose
        return '' unless examples

        examples.join("\n\n")
      end

      def resources
        @resources ||= raml.resources
      end

      def example_groups
        @example_groups ||= resources.map {|r| ExampleGroup.new(r, options) }
      end

      def generate!
        @examples = example_groups.map(&:render)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rambo_ruby-0.7.1 lib/rambo/rspec/examples.rb
rambo_ruby-0.7.0 lib/rambo/rspec/examples.rb
rambo_ruby-0.6.0 lib/rambo/rspec/examples.rb
rambo_ruby-0.5.0 lib/rambo/rspec/examples.rb
rambo_ruby-0.4.0 lib/rambo/rspec/examples.rb
rambo_ruby-0.3.3 lib/rambo/rspec/examples.rb
rambo_ruby-0.3.2 lib/rambo/rspec/examples.rb
rambo_ruby-0.3.1 lib/rambo/rspec/examples.rb
rambo_ruby-0.3.0 lib/rambo/rspec/examples.rb
rambo_ruby-0.2.3 lib/rambo/rspec/examples.rb
rambo_ruby-0.2.2 lib/rambo/rspec/examples.rb
rambo_ruby-0.2.1 lib/rambo/rspec/examples.rb
rambo_ruby-0.2.0 lib/rambo/rspec/examples.rb