1 # This file contains various classes used by the specs.
10 return @name == other.name
14 class ClassWithMultiWordPredicate
15 def multi_word_predicate?
21 class CollectionWithSizeMethod
22 def initialize; @list = []; end
23 def size; @list.size; end
24 def push(item); @list.push(item); end
27 class CollectionWithLengthMethod
28 def initialize; @list = []; end
29 def length; @list.size; end
30 def push(item); @list.push(item); end
34 attr_reader :items_in_collection_with_size_method, :items_in_collection_with_length_method
37 @items_in_collection_with_size_method = CollectionWithSizeMethod.new
38 @items_in_collection_with_length_method = CollectionWithLengthMethod.new
41 def add_to_collection_with_size_method(item)
42 @items_in_collection_with_size_method.push(item)
45 def add_to_collection_with_length_method(item)
46 @items_in_collection_with_length_method.push(item)
50 return [1, 2, 3] if arg == 'a'
55 @items_in_collection_with_size_method
60 include Spec::Matchers
61 def initialize(return_val)
62 @return_val = return_val
83 def multi_word_predicate?
88 @funny_called.should be_true
91 class ClassWithUnqueriedPredicate
102 require 'spec/runner/formatter/base_text_formatter'
103 class Formatter < Spec::Runner::Formatter::BaseTextFormatter
104 attr_reader :options, :where
106 def initialize(options, where)
112 class BadFormatter < Spec::Runner::Formatter::BaseTextFormatter
115 def initialize(options, where)
122 def initialize(options)
128 class FakeReporter < Spec::Runner::Reporter