Sha256: 16f668244822078afd682b0c217071b6fb9f1052c9d269f43f321205e4550319

Contents?: true

Size: 1.63 KB

Versions: 54

Compression:

Stored size: 1.63 KB

Contents

# This file contains various classes used by the specs.
module Micronaut
  module Expectations
    class Person
      attr_reader :name
      def initialize name
        @name = name
      end
      def == other
        return @name == other.name
      end
    end
    
    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

      class ClassWithUnqueriedPredicate
        attr_accessor :foo
        def initialize(foo)
          @foo = foo
        end
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 3 rubygems

Version Path
rsanheim-micronaut-0.1.3.2 examples/resources/example_classes.rb
rsanheim-micronaut-0.1.4.1 examples/resources/example_classes.rb
spicycode-micronaut-0.0.3 examples/resources/example_classes.rb
spicycode-micronaut-0.0.4 examples/resources/example_classes.rb
spicycode-micronaut-0.0.5 examples/resources/example_classes.rb
spicycode-micronaut-0.0.6 examples/resources/example_classes.rb
spicycode-micronaut-0.0.7 examples/resources/example_classes.rb
spicycode-micronaut-0.0.9 examples/resources/example_classes.rb
spicycode-micronaut-0.1.0 examples/resources/example_classes.rb
spicycode-micronaut-0.1.1 examples/resources/example_classes.rb
spicycode-micronaut-0.1.2 examples/resources/example_classes.rb
spicycode-micronaut-0.1.3 examples/resources/example_classes.rb
spicycode-micronaut-0.1.4.1 examples/resources/example_classes.rb
spicycode-micronaut-0.1.4.2 examples/resources/example_classes.rb
spicycode-micronaut-0.1.4.3 examples/resources/example_classes.rb
spicycode-micronaut-0.1.4.4 examples/resources/example_classes.rb
spicycode-micronaut-0.1.4 examples/resources/example_classes.rb
spicycode-micronaut-0.1.5.2 examples/resources/example_classes.rb
spicycode-micronaut-0.1.5 examples/resources/example_classes.rb
spicycode-micronaut-0.1.6.1 examples/resources/example_classes.rb