Sha256: 772513acb303d514948f74c03d3b7e720ac2c96b0889120819c3001abfedf97f

Contents?: true

Size: 867 Bytes

Versions: 8

Compression:

Stored size: 867 Bytes

Contents

require 'coveralls'
Coveralls.wear!

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require "rubygems"
require 'webidl'
require 'rspec'
require "pp"


# require "ruby-debug"
# Debugger.start
# Debugger.settings[:autoeval] = true
# Debugger.settings[:autolist] = 1

module ParseHelper
  CACHE = {}

  def parse(input)
    result = CACHE.fetch(input) { CACHE[input] = @parser.parse(input) }

    unless result
      raise @parser.failure_reason
    end

    result
  end

  def generate(str)
    generator.generate(str)
  end

  def generator
    @generator ||= WebIDL::Generator.new
  end

  def fixture(name)
    File.read("#{File.dirname(__FILE__)}/fixtures/#{name}")
  end
end

RSpec.configure do |c|
  c.include(ParseHelper)
  c.before(:each) do
    @parser = WebIDL::Parser::IDLParser.new
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
webidl-0.2.2 spec/spec_helper.rb
webidl-0.2.1 spec/spec_helper.rb
webidl-0.1.10 spec/spec_helper.rb
webidl-0.2.0 spec/spec_helper.rb
webidl-0.1.9 spec/spec_helper.rb
webidl-0.1.8 spec/spec_helper.rb
webidl-0.1.7 spec/spec_helper.rb
webidl-0.1.6 spec/spec_helper.rb