Sha256: 74534f8864533d60cc0b535fb34ccf8328080bc759b82301bbbbc8dbd55a24d9

Contents?: true

Size: 765 Bytes

Versions: 1

Compression:

Stored size: 765 Bytes

Contents

# encoding: utf-8

# Rspecの内部でflextures関数を使える様にする
module RSpec
  module Core
    module Hooks
      def flextures *_
        before { Flextures::Loader::flextures *_ }
      end
    end
  end
end

# 既存のsetup_fixturesの機能を上書きする必要があったのでこちらを作成
module ActiveRecord
  module TestFixtures
    alias :flextures_backup_setup_fixtures :setup_fixtures
    def setup_fixtures
      flextures_backup_setup_fixtures
      Flextures::init_load
    end

    alias :flextures_backup_teardown_fixtures :teardown_fixtures
    def teardown_fixtures
      flextures_backup_teardown_fixtures
      Flextures::init_tables if Flextures::Config.init_all_tables
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flextures-1.9.4 lib/flextures/rspec_flextures_support.rb