friendly_test_names 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README +44 -0
  2. data/lib/friendly_test_names.rb +7 -0
  3. metadata +47 -0
data/README ADDED
@@ -0,0 +1,44 @@
1
+ Friendly test names
2
+ ===================
3
+
4
+ What is it?
5
+ -----------
6
+
7
+ This tiny extension for test/unit allows you to write this:
8
+
9
+ class LolCatTest < Test::Unit::TestCase
10
+ test 'can haz cheeseburger' do
11
+ assert @lolcat.can_haz_cheeseburger?
12
+ end
13
+ end
14
+
15
+ instead of this:
16
+
17
+ class LoLCatTest < Test::Unit::TestCase
18
+ def test_can_haz_cheeseburger do
19
+ assert @lolcat.can_haz_cheeseburger?
20
+ end
21
+ end
22
+
23
+ Nothing more, nothing less.
24
+
25
+
26
+ How to use it?
27
+ --------------
28
+
29
+ Just require "friendly_test_names" in your test. Done.
30
+
31
+
32
+ But <insert your favorite test tool> does this plus much more!
33
+ -------------------------------------------------------------
34
+
35
+ Yes, but I don't want much more. I don't want contexts, fancy macros or
36
+ rspec-esque pseudo plain language DSL. I want just friendly test name, nothing
37
+ more.
38
+
39
+
40
+ Legal
41
+ -----
42
+
43
+ Copyright 2011 Adam Cigánek. Distributed under the terms of Do What The Fuck
44
+ You Want To Public Licence (WTFPL).
@@ -0,0 +1,7 @@
1
+ Test::Unit::TestCase.class_eval do
2
+ def self.test(name, &block)
3
+ test_name = "test: #{name}"
4
+ raise "Test #{test_name} is already defined in #{self}" if method_defined?(test_name)
5
+ define_method(test_name, &block)
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: friendly_test_names
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Adam Cigánek
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-26 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: This tiny extension for test/unit allows you to write "test 'has cheeseburger'
15
+ do; ...; end" instead of "def test_has_cheeseburger; ...; end". Nothing more.
16
+ email: adam.ciganek@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - README
22
+ - lib/friendly_test_names.rb
23
+ homepage:
24
+ licenses: []
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 1.8.6
44
+ signing_key:
45
+ specification_version: 3
46
+ summary: Define tests using plain language, no_more_underscore_madness.
47
+ test_files: []