Sha256: bc8d398e88e4d9181c02fd43542e564057845ba18fe666689b1e72e74874c704

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe WebIDL::Parser::IDLParser do

  #
  # interfaces
  #

  it "parses an empty interface" do
    parse(fixture("empty_interface.idl")).should_not be_nil
  end

  it "parses a module with several interfaces" do
    result = parse fixture("framework.idl")
    result.should_not be_nil
  end

  it "parses an interface with an attribute" do
    parse(fixture("interface_with_attribute.idl")).should_not be_nil
  end


  #
  # various
  #

  it "parses a known type followed by other characters" do
    str = <<-IDL
      interface Foo { readonly attribute DOMStringMap bar;  };
    IDL

    parse(str).should_not be_nil
  end

  it "parses array types" do
    str = <<-IDL
      interface Bar {
        readonly attribute short[] foo;
        readonly attribute short[ ] bar;
      };
    IDL

    parse(str).should_not be_nil
  end

  it "parses hex numbers" do
    str = <<-IDL
      interface Bar { const unsigned long NULL = 0x0000; };
    IDL

    parse(str).should_not be_nil
  end

  it "parses static types" do
    str = <<-IDL
      interface Bar { static DOMString createBar(); };
    IDL

    parse(str).should_not be_nil
  end

  it "parses the WebSocket interface idl" do
    parse(fixture("websocket.idl")).should_not be_nil
  end

  it "parses the HTML5 DOM interface idl" do
    parse(fixture("html5.idl")).should_not be_nil
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webidl-0.1.8 spec/parser_spec.rb
webidl-0.1.7 spec/parser_spec.rb
webidl-0.1.6 spec/parser_spec.rb