Sha256: 2d6abc8cfabf038d99bd465ca71f3be88238e204ef9e07c0953d3f4e9cef590c

Contents?: true

Size: 568 Bytes

Versions: 150

Compression:

Stored size: 568 Bytes

Contents

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
        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

Version data entries

150 entries across 119 versions & 14 rubygems

Version Path
gemstreamer-1.1.0 spec/assets/testapp/vendor/rails/activesupport/lib/active_support/testing/declarative.rb
gemstreamer-1.0.0 spec/assets/testapp/vendor/rails/activesupport/lib/active_support/testing/declarative.rb
gemstreamer-0.0.0 spec/assets/testapp/vendor/rails/activesupport/lib/active_support/testing/declarative.rb
radiant-rc-0.9.0 vendor/rails/activesupport/lib/active_support/testing/declarative.rb
webroar-0.2.2 src/admin_panel/vendor/rails/activesupport/lib/active_support/testing/declarative.rb
radiant-0.8.1 vendor/rails/activesupport/lib/active_support/testing/declarative.rb
activesupport-2.3.4 lib/active_support/testing/declarative.rb
activesupport-2.3.3 lib/active_support/testing/declarative.rb
activesupport-2.3.2 lib/active_support/testing/declarative.rb
radiant-0.8.0 vendor/rails/activesupport/lib/active_support/testing/declarative.rb