Permalink
Browse files

Make the use of canary more idiomatic, use times instead of at_least …

…for an exact number of matches
  • Loading branch information...
1 parent bce931f commit fcd8d744b871dcf168c64c58d14229fef0d6fe9c @wjessop wjessop committed Sep 20, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 spec/lib/scamp_spec.rb
@@ -190,11 +190,11 @@
it "should not match without prefix when required_prefix is true" do
canary = mock
- canary.expects(:lives).never
+ canary.expects(:bang).never
bot = a Scamp, :required_prefix => 'Bot: '
bot.behaviour do
- match("a string") {canary.lives}
+ match("a string") {canary.bang}
end
bot.send(:process_message, {:body => "a string"})
@@ -264,11 +264,11 @@
it "should not match without prefix when required_prefix is present" do
canary = mock
- canary.expects(:lives).never
+ canary.expects(:bang).never
bot = a Scamp, :required_prefix => /^Bot[\:,\s]+/i
bot.behaviour do
- match(/a string/) {canary.lives}
+ match(/a string/) {canary.bang}
end
bot.send(:process_message, {:body => "a string"})
@@ -278,7 +278,7 @@
it "should match with regex prefix when required_prefix is present" do
canary = mock
- canary.expects(:lives).at_least(4)
+ canary.expects(:lives).times(4)
bot = a Scamp, :required_prefix => /^Bot\W{1,2}/i
bot.behaviour do

0 comments on commit fcd8d74

Please sign in to comment.