Sha256: 43818c3f640f3bab7ffbe40c23b2fd4969af750c23b5854eaa1afafbbe814202

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

require "rspec/example_group"

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

      def initialize(raml, options={})
        @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

1 entries across 1 versions & 1 rubygems

Version Path
rambo_ruby-0.1.0 lib/rspec/examples.rb