Sha256: f8202fdc866acaddca214cbc7ba89388f850e99032c456fbca9233f4d41c1585

Contents?: true

Size: 492 Bytes

Versions: 3

Compression:

Stored size: 492 Bytes

Contents

# backtick_javascript: true

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.1.0.alpha3 lib-opal/opal/rspec/formatter/document_io.rb
opal-rspec-1.1.0.alpha2 lib-opal/opal/rspec/formatter/document_io.rb
opal-rspec-1.1.0.alpha1 lib-opal/opal/rspec/formatter/document_io.rb