Sha256: 6f271778578ea7aa0bc456466078969e58a0cacee53208d856dbeced62ab2de1

Contents?: true

Size: 463 Bytes

Versions: 3

Compression:

Stored size: 463 Bytes

Contents

module Opal
  module RSpec
    class DocumentIO < IO
      include IO::Writable if defined? IO::Writable

      def initialize
        `document.open()`
      end

      def close
        @closed = true
        `document.close()`
      end

      def write(html)
        if @closed
          `console.error(#{"DOC closed, can't write #{html}" })`
        else
          `document.write(#{html})`
        end
      end

      def flush
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-rspec-1.0.0 lib-opal/opal/rspec/formatter/document_io.rb
opal-rspec-1.0.0.alpha1 lib-opal/opal/rspec/formatter/document_io.rb
opal-rspec-0.8.0 lib-opal/opal/rspec/formatter/document_io.rb