Sha256: 1c240bc5f427598f1d8f1f967d3d7d78bb98b5eefb42af1bafec26e0ba6ce7b0

Contents?: true

Size: 913 Bytes

Versions: 2

Compression:

Stored size: 913 Bytes

Contents

require 'vedeu/repositories/model'
require 'vedeu/output/presentation'

module Vedeu

  module RepositoryTestModule

    extend self

    # The real repository stores the model and returns it.
    def store(model)
      model
    end

    private

    # A storage solution that uses memory to persist models.
    def in_memory
      {}
    end

  end # RepositoryTestModule

  class ModelTestClass

    include Vedeu::Model
    include Vedeu::Presentation

    attr_accessor :background, :colour, :name, :style

    def initialize(attributes = {})
      @attributes = defaults.merge!(attributes)

      @colour = @attributes[:colour]
      @name   = @attributes[:name]
      @style  = @attributes[:style]
      @repository = Vedeu::RepositoryTestModule
    end

    private

    def defaults
      {
        colour: {},
        name:   '',
        style:  [],
      }
    end

  end # ModelTestClass

end # Vedeu

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vedeu-0.4.18 test/support/helpers/model_test_class.rb
vedeu-0.4.17 test/support/helpers/model_test_class.rb