spec/excesselt_spec.rb in excesselt-1.1.0 vs spec/excesselt_spec.rb in excesselt-1.1.1

- old
+ new

@@ -65,23 +65,29 @@ EXPECTED @stylesheet.transform(xml).should match_the_dom_of(expected) end describe "error handling" do + it "should record errors encountered during processing" do xml = <<-XML <parent>foo</parent> XML @instance = @stylesheet.new @instance.transform(xml) @instance.errors.should == ["Text is not allowed within a parent node!"] end + it "should record errors encountered during processing" do xml = <<-XML - <parent class="explode">foo</parent> + <parent><unexpected></unexpected></parent> XML @instance = @stylesheet.new - lambda { @instance.transform(xml) }.should raise_exception {|e| e.message.should =~ /With selector .* and included modules: \[TestHelper\]/} + lambda { @instance.transform(xml) }.should raise_exception {|e| + e.message.should =~ /With selector .* and included modules: \[TestHelper\]/ + e.message.should =~ /There is no style defined to handle element 'unexpected' in this context \(document, parent\)/ + + } end end end