Sha256: 24b4419bc2cfe06974d634f99f2b12e59af590828dddf9a2c687755b9edcd794

Contents?: true

Size: 874 Bytes

Versions: 2

Compression:

Stored size: 874 Bytes

Contents

# encoding: utf-8

# flxtures function shouda support
module Shoulda
  module Context
    module ClassMethods
      def flextures *_
        context = Shoulda::Context.current_context
        context.setup_blocks<< ->{ Flextures::Loader::flextures *_ }
      end

      def flextures_delete *_
        context = Shoulda::Context.current_context
        context.setup_blocks<< -> {
          if _.empty?
            Flextures::init_tables
          else
            Flextures::delete_tables *_
          end
        }
      end

      def flextures_set_options options={}
        context = Shoulda::Context.current_context
        context.setup_blocks<< -> {
          Flextures::Loader::set_options options
        }
        context.teardown_blocks<< -> {
          Flextures::Loader::delete_options
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flextures-3.0.1 lib/flextures/testunit_flextures_support.rb
flextures-3.0.0 lib/flextures/testunit_flextures_support.rb