Sha256: 154cc2746584e2acaddbf7d536465ea76037de3e884653f13f683fb810f98e2b

Contents?: true

Size: 865 Bytes

Versions: 2

Compression:

Stored size: 865 Bytes

Contents

module JsTestCore
  module Resources
    module Specs
      module Spec
        class << self
          def spec_representation_class
            @spec_representation_class ||= JsTestCore::Representations::Spec
          end
          attr_writer :spec_representation_class
        end

        def get_generated_spec
          connection.terminate_after_sending do
            connection.send_head(
              200,
              'Content-Type' => "text/html",
              'Last-Modified' => ::File.mtime(absolute_path).rfc822
            )

            body = render_spec
            connection.send_data("Content-Length: #{body.length}\r\n\r\n")
            connection.send_data(body)
          end
        end

        def render_spec
          Spec.spec_representation_class.new(self, :spec_files => spec_files).to_s
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pivotal-screw-unit-0.4.0 vendor/js-test-core/lib/js_test_core/resources/specs/spec.rb
pivotal-screw-unit-0.4.1 vendor/js-test-core/lib/js_test_core/resources/specs/spec.rb