Sha256: aae5a20dca7de76f93be1ba83da8b38e30c12650ab07d03345a6d303df72c01b

Contents?: true

Size: 805 Bytes

Versions: 5

Compression:

Stored size: 805 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

5 entries across 5 versions & 1 rubygems

Version Path
webidl-0.0.6 spec/spec_helper.rb
webidl-0.0.5 spec/spec_helper.rb
webidl-0.0.4 spec/spec_helper.rb
webidl-0.0.3 spec/spec_helper.rb
webidl-0.0.2 spec/spec_helper.rb