Sha256: 4a205707f8909c19115ea199baa90699c841d857920b8bc7e3ae88e01b74d593

Contents?: true

Size: 1010 Bytes

Versions: 24

Compression:

Stored size: 1010 Bytes

Contents

# helpers for use in testing

module Mock
  class Block
    def to_proc
      lambda { |*args| call(*args) }
    end

    # the call method must be provided by in specs
    # E.g. using `expect(mock_block_instance).to receive(:call)` to assert that the "block" gets called
    def call
      raise NotImplementedError, "Expecting `call` method to have an expectation defined to assert."
    end
  end

  module Valid
    def valid?
      true
    end
  end

  module Invalid
    def valid?
      false
    end
  end

  class ValidCommand < Riveter::Command::Base
    include Valid
  end

  class InvalidCommand < Riveter::Command::Base
    include Invalid
  end

  class ValidQueryFilter < Riveter::QueryFilter::Base
    include Valid
  end

  class InvalidQueryFilter < Riveter::QueryFilter::Base
    include Invalid
  end

  class QueryWithData < Riveter::Query::Base
    def has_data?
      true
    end
  end

  class QueryWithoutData < Riveter::Query::Base
    def has_data?
      false
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
riveter-0.8.3 lib/riveter/spec_helper.rb
riveter-0.8.2 lib/riveter/spec_helper.rb
riveter-0.8.1 lib/riveter/spec_helper.rb
riveter-0.8.0 lib/riveter/spec_helper.rb
riveter-0.7.0 lib/riveter/spec_helper.rb
riveter-0.6.0 lib/riveter/spec_helper.rb
riveter-0.3.0 lib/riveter/spec_helper.rb
riveter-0.2.1 lib/riveter/spec_helper.rb
riveter-0.2.0 lib/riveter/spec_helper.rb
riveter-0.1.1 lib/riveter/spec_helper.rb
riveter-0.0.15 lib/riveter/spec_helper.rb
riveter-0.0.14 lib/riveter/spec_helper.rb
riveter-0.0.13 lib/riveter/spec_helper.rb
riveter-0.0.12 lib/riveter/spec_helper.rb
riveter-0.0.11 lib/riveter/spec_helper.rb
riveter-0.0.10 lib/riveter/spec_helper.rb
riveter-0.0.9 lib/riveter/spec_helper.rb
riveter-0.0.8 lib/riveter/spec_helper.rb
riveter-0.0.7 lib/riveter/spec_helper.rb
riveter-0.0.6 lib/riveter/spec_helper.rb