Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
add description to AnyArgMatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Aug 11, 2009
1 parent f6e7c01 commit c73fa5c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/spec/mocks/argument_matchers.rb
Expand Up @@ -15,18 +15,22 @@ def description
end
end

class NoArgsMatcher
def description
"no args"
end
end

class AnyArgMatcher
def initialize(ignore)
end

def ==(other)
true
end
end

class NoArgsMatcher

def description
"no args"
"anything"
end
end

Expand Down
19 changes: 19 additions & 0 deletions spec/spec/mocks/argument_matchers_spec.rb
@@ -0,0 +1,19 @@
require 'spec/spec_helper'

module Spec
module Mocks
module ArgumentMatchers
describe AnyArgsMatcher do
it "represents itself nicely for failure messages" do
AnyArgsMatcher.new.description.should == "any args"
end
end

describe AnyArgMatcher do
it "represents itself nicely for failure messages" do
AnyArgMatcher.new(nil).description.should == "anything"
end
end
end
end
end

0 comments on commit c73fa5c

Please sign in to comment.