test_declarative-0.0.6/0000755000004100000410000000000013117554674015104 5ustar www-datawww-datatest_declarative-0.0.6/MIT-LICENSE0000644000004100000410000000211213117554673016533 0ustar www-datawww-dataMIT LICENSE Copyright (c) 2010 Sven Fuchs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. test_declarative-0.0.6/lib/0000755000004100000410000000000013117554673015651 5ustar www-datawww-datatest_declarative-0.0.6/lib/test_declarative/0000755000004100000410000000000013117554673021173 5ustar www-datawww-datatest_declarative-0.0.6/lib/test_declarative/version.rb0000644000004100000410000000005713117554673023207 0ustar www-datawww-datamodule TestDeclarative VERSION = '0.0.6' end test_declarative-0.0.6/lib/test_declarative.rb0000644000004100000410000000177213117554673021527 0ustar www-datawww-datatargets = [Module] targets << Test::Unit::TestCase if defined?(Test::Unit::TestCase) targets << MiniTest::Unit::TestCase if defined?(MiniTest::Unit::TestCase) targets << Minitest::Test if defined?(Minitest::Test) targets.each do |target| if target.respond_to? :test warn "test_declarative is deprecated for #{target}" next end target.class_eval do 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 target.instance_eval do alias :orig_test_methods :test_methods def test_methods methods = orig_test_methods methods.delete('test') methods end end if target.respond_to?(:test_methods) end test_declarative-0.0.6/test_declarative.gemspec0000644000004100000410000000212513117554674021773 0ustar www-datawww-data######################################################### # This file has been automatically generated by gem2tgz # ######################################################### # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "test_declarative" s.version = "0.0.6" s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version= s.authors = ["Sven Fuchs"] s.date = "2017-05-23" s.description = "Simply adds a declarative test method syntax to test/unit." s.email = "svenfuchs@artweb-design.de" s.files = ["MIT-LICENSE", "README.md", "lib/test_declarative.rb", "lib/test_declarative/version.rb"] s.homepage = "http://github.com/svenfuchs/test_declarative" s.licenses = ["MIT"] s.require_paths = ["lib"] s.rubyforge_project = "[none]" s.rubygems_version = "1.8.23" s.summary = "Simply adds a declarative test method syntax to test/unit" if s.respond_to? :specification_version then s.specification_version = 4 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then else end else end end test_declarative-0.0.6/README.md0000644000004100000410000000055113117554673016363 0ustar www-datawww-data# TestDeclarative [![Build Status](https://api.travis-ci.org/svenfuchs/test_declarative.svg?branch=master)](https://travis-ci.org/svenfuchs/test_declarative) Simply adds a declarative test method syntax to test/unit. ```ruby require 'test_declarative' class MyTest < Test::Unit::TestCase test "your test description" do # your test code end end ```