spec/generator_spec.rb in webidl-0.0.1 vs spec/generator_spec.rb in webidl-0.0.2

- old
+ new

@@ -87,6 +87,31 @@ RUBY actual = generate(fixture("module_with_implements_statement.idl")) actual.should == expected end + + it "generates code for no-name setters, getters, creators, stringifier and deleters" do + expected = <<-RUBY +module Foo + def initialize(foo) + raise(NotImplementedError) + end + def []=(key, value) + raise(NotImplementedError) + end + def [](key) + raise(NotImplementedError) + end + def to_s + raise(NotImplementedError) + end + def delete! + raise(NotImplementedError) + end +end +RUBY + + actual = generate(fixture("interface_with_specials.idl")) + actual.should == expected.strip + end end