Sha256: b16ee0e3225b719fa54f44c7da0c16c56bf7c709f53cacd8986c0727b39a40d2

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

module MiniTestSpecRails
  module Init
    module MiniShouldaBehavior

      def self.included(klass)
        klass.class_eval do
          class << self
            
            alias :context  :describe
            alias :should   :it

            def setup_with_minitest(*args, &block)
              if args.first.is_a?(Symbol) && !block_given?
                setup_without_minitest(args.first)
              else
                setup_without_minitest { |o| o.instance_eval(&block) }
              end
            end
            alias_method_chain :setup, :minitest

            def teardown_with_minitest(*args, &block)
              if args.first.is_a?(Symbol) && !block_given?
                teardown_without_minitest(args.first)
              else
                teardown_without_minitest { |o| o.instance_eval(&block) }
              end
            end
            alias_method_chain :teardown, :minitest

          end
          extend ClassMethods
        end
      end

      module ClassMethods

        def should_eventually(desc)
          it("should eventually #{desc}") { skip("Should eventually #{desc}") }
        end

      end

    end
  end
end

ActiveSupport::TestCase.send :include, MiniTestSpecRails::Init::MiniShouldaBehavior

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minitest-spec-rails-3.1.2 lib/minitest-spec-rails/init/mini_shoulda.rb
minitest-spec-rails-3.1.1 lib/minitest-spec-rails/init/mini_shoulda.rb
minitest-spec-rails-3.1.0 lib/minitest-spec-rails/init/mini_shoulda.rb