Sha256: 0db8770a35b56549e8a3a40866c99ddd37fc5a76a8f061b4c2b402126e1bed02

Contents?: true

Size: 1.35 KB

Versions: 5

Compression:

Stored size: 1.35 KB

Contents

# This file contains various classes used by the specs.
module Rspec
  module Expectations
    # class ClassWithMultiWordPredicate
    #   def multi_word_predicate?
    #     true 
    #   end
    # end
    # 
    module Helper
      class CollectionWithSizeMethod
        def initialize; @list = []; end
        def size; @list.size; end
        def push(item); @list.push(item); end
      end
      
      class CollectionWithLengthMethod
        def initialize; @list = []; end
        def length; @list.size; end
        def push(item); @list.push(item); end
      end

      class CollectionOwner
        attr_reader :items_in_collection_with_size_method, :items_in_collection_with_length_method
      
        def initialize
          @items_in_collection_with_size_method = CollectionWithSizeMethod.new
          @items_in_collection_with_length_method = CollectionWithLengthMethod.new
        end
      
        def add_to_collection_with_size_method(item)
          @items_in_collection_with_size_method.push(item)
        end
      
        def add_to_collection_with_length_method(item)
          @items_in_collection_with_length_method.push(item)
        end
      
        def items_for(arg)
          return [1, 2, 3] if arg == 'a'
          [1]
        end
      
        def items
          @items_in_collection_with_size_method
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-expectations-2.0.0.a6 spec/support/classes.rb
rspec-expectations-2.0.0.a5 spec/support/classes.rb
rspec-expectations-2.0.0.a4 spec/support/classes.rb
rspec-expectations-2.0.0.a3 spec/support/classes.rb
rspec-expectations-2.0.0.a2 spec/support/classes.rb