Skip to content

Commit

Permalink
Fixed specs using Product.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Nov 1, 2010
1 parent 935efbb commit 9bfbcde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/ast/pattern_spec.rb
Expand Up @@ -117,7 +117,7 @@
pattern = p1 * 2

pattern.should be_an_instance_of(Pegarus::Product)
pattern.first.should equal(p1)
pattern.second.should == 2
pattern.pattern.should equal(p1)
pattern.count.should == 2
end
end
4 changes: 2 additions & 2 deletions spec/ast/product_spec.rb
Expand Up @@ -3,15 +3,15 @@
describe "Product.new" do
it "converts the first input to a pattern" do
pattern = Pegarus::Product.new "a", 1
pattern.first.should be_an_instance_of(Pegarus::Character)
pattern.pattern.should be_an_instance_of(Pegarus::Character)
end

it "calls #to_int to convert the second input" do
obj = mock("multiplier")
obj.should_receive(:to_int).and_return(2)

pattern = Pegarus::Product.new "a", obj
pattern.second.should == 2
pattern.count.should == 2
end

it "raises a TypeError if the second input is nil" do
Expand Down

0 comments on commit 9bfbcde

Please sign in to comment.