Permalink
Browse files

! specs

  • Loading branch information...
1 parent 9feb81d commit 983b71d53670577583b2b792b75c6763c7d4331d @kschiess committed May 25, 2012
Showing with 10 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +3 −1 lib/parslet/cause.rb
  3. +6 −2 spec/parslet/error_reporter/deepest_spec.rb
View
@@ -1,3 +1,4 @@
+website/.sass-cache
.yardoc
test.rb
.rspec
View
@@ -26,7 +26,9 @@ def initialize(message, source, pos, children)
# node. Very often carries the reasons for this cause.
#
# @return [Array<Parslet::Cause>] A list of reasons for this cause.
- attr_reader :children
+ def children
+ @children ||= []
+ end
# Appends 'at line LINE char CHAR' to the string given. Use +pos+ to
# override the position of the +source+. This method returns an object
@@ -5,7 +5,9 @@
let(:fake_source) { flexmock('source') }
describe '#err' do
- before(:each) { fake_source.should_receive(:pos => 13) }
+ before(:each) { fake_source.should_receive(
+ :pos => 13,
+ :line_and_column => [1,1]) }
it "returns the deepest cause" do
flexmock(reporter).
@@ -15,7 +17,9 @@
end
end
describe '#err_at' do
- before(:each) { fake_source.should_receive(:pos => 13) }
+ before(:each) { fake_source.should_receive(
+ :pos => 13,
+ :line_and_column => [1,1]) }
it "returns the deepest cause" do
flexmock(reporter).

0 comments on commit 983b71d

Please sign in to comment.