Sha256: f53ffc8cfc080aaef8d9043233e99f0c4c15b226fa5992d1c6cdac3cc50dab3f

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'bolt'

# Rails support
if File.exists?('test/test_helper.rb')
  puts '** Rails found, loading environment'
  ENV['RAILS_ENV'] = 'test'
  require 'test/test_helper.rb'
end

# This is a hack for Rails Test::Unit to prevent raising errors when a test file is loaded again
module ActiveSupport
  module Testing
    module Declarative
      # test "verify something" do
      #   ...
      # end
      def test(name, &block)
        test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
        defined = instance_method(test_name) rescue false
        # raise "#{test_name} is already defined in #{self}" if defined # do not raise this error
        if block_given?
          define_method(test_name, &block)
        else
          define_method(test_name) do
            flunk "No implementation provided for #{name}"
          end
        end
      end
    end
  end
end

# start a listener
Bolt::Listener.new

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
marcinbunsch-bolt-0.1.0 bin/bolt
marcinbunsch-bolt-0.1.4 bin/bolt