Sha256: 7210c36802026626fc17e542fba20e34e3ec7c4006e808c5675f6e186793f7ef

Contents?: true

Size: 721 Bytes

Versions: 3

Compression:

Stored size: 721 Bytes

Contents

module RSpec
  module Rabl
    module ExampleGroup
      def parsed_json
        JSON.parse(rendered_template)
      end

      def rendered_template
        renderer.render
      end

      def renderer
        @renderer ||= ::Rabl::Renderer.new(
          _rabl_template.gsub('.rabl',''),
          _rabl_data,
          :view_path => _rabl_config[:view_paths],
        )
      end

      def subject
        renderer
      end

      private
      def _rabl_config
        RSpec.configuration.rabl_configuration
      end

      def _rabl_data
        nil
      end

      def _rabl_opts
        {}
      end

      def _rabl_template
        example.metadata[:example_group][:description]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec_rabl-0.0.3 lib/rspec/rabl/example_group.rb
rspec_rabl-0.0.2 lib/rspec/rabl/example_group.rb
rspec_rabl-0.0.1 lib/rspec/rabl/example_group.rb