Sha256: 6da81a0727e29f6a2c5fef31b40b82c186e2db8cab8a4088364341bd06b57f89

Contents?: true

Size: 489 Bytes

Versions: 3

Compression:

Stored size: 489 Bytes

Contents

require 'active_support/concern'
require 'active_support/test_case'

module NamedSeeds
  module TestHelper

    extend ActiveSupport::Concern

    def after_teardown
      super
      NamedSeeds.reset_cache
    end

    module ClassMethods

      def named_seeds(name, options={})
        define_method(name) do |*identities|
          Identity.named(name, options).find(*identities)
        end
      end

    end

  end
end

ActiveSupport::TestCase.send :include, NamedSeeds::TestHelper

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
named_seeds-2.1.0 lib/named_seeds/rails.rb
named_seeds-2.0.1 lib/named_seeds/rails.rb
named_seeds-2.0.0 lib/named_seeds/rails.rb