Sha256: a9f088fd117e9547f90a5b47603077573b7f9553b67583ecd95b52258fb9c2b2

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

module Upgrow
  class BasicRepositoryTest < ActiveSupport::TestCase
    class UserRepository < BasicRepository; end

    setup do
      @original_base = UserRepository.base
      @repository = UserRepository.new
    end

    teardown do
      UserRepository.base = @original_base
    end

    test '.base is nil by default' do
      assert_nil UserRepository.base
    end

    test '.base can be set' do
      UserRepository.base = :my_base
      assert_equal :my_base, UserRepository.base
    end

    test '#base is inferred from the Repository class base' do
      UserRepository.base = :my_base
      assert_equal :my_base, UserRepository.new.base
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upgrow-0.0.5 test/upgrow/basic_repository_test.rb
upgrow-0.0.4 test/upgrow/basic_repository_test.rb