Commits

Kaspar Schiess committed 4d2d260

Missing spec

Comments (0)

Files changed (2)

lib/par/source.rb

     end
     def pattern pat
       idx = head.index(pat)
-      return bottom unless idx == 0
+      return Par.bottom unless idx == 0
       md =head.match(pat)
       n(md[0].size)
     end

spec/lib/par/source_spec.rb

       r = s.pattern /foo/
       r == 'foo'
     end
+    it "returns bottom if no match" do
+      s.pattern(/bar/).should == bottom
+    end 
   end
   describe "#cr" do
     let(:s) { source 'foobar' }