Sha256: c65de98f5431239a72c06602265e36022ef2f12671b01a6a152713222ec10c21

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 Bytes

Contents

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

require "rubygems"
require 'webidl'
require 'spec'
require 'spec/autorun'
require "pp"

require "ruby-debug"

Debugger.start
Debugger.settings[:autoeval] = true
Debugger.settings[:autolist] = 1

module ParseHelper
  def parse(input)
    result = @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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
webidl-0.0.1 spec/spec_helper.rb