paramesan 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ec829da8c0a763523519359e2759713f8ca3e3f
4
- data.tar.gz: c56c3ef7d36f622257e685b20e08de3920cc9fbb
3
+ metadata.gz: 3588ccf21c136cc11ef86b4551317836898aed56
4
+ data.tar.gz: e1161b477394209a86c123ec328c09330640c4b1
5
5
  SHA512:
6
- metadata.gz: cb0308e57a4659cc8939a28d6143fe87829594e3729ba17cbce7ce5c17e6fcb47c5c7c10130ea5c12e07a8cc215cd6c4943d4d0a10091977f51c04d3918c302b
7
- data.tar.gz: adea8068805d95b7c483102ec1baea0b2f3c778095b49053082ef6125cd08ccebd39bd2fa484198ef2c9b9b85c21800122ae8ef6b603ec1ccd4976f3b5f5743c
6
+ metadata.gz: 5455dc909ec3b11d9f11afd7d9b9caf6ce89bd23ad4c74c14d69956cc707ffab51daed4467fb54836051cee3560be0ff09f22089387d56403d05750567a78946
7
+ data.tar.gz: b919e75b9f002b986d15886705b4308e5a571bf1409c25529e64c97c63069a899b8c6b8708e69c75ba6f3d8af3e6eb9fd1f3fc1bb7e91c53ceeba36de39739ea
data/README.md CHANGED
@@ -15,7 +15,9 @@ and output as data that go through the process.
15
15
  I looked for the equivalent in Ruby, and the closest that I found was
16
16
  [param_test](https://www.ruby-toolbox.com/projects/param_test). That, however, uses activesupport,
17
17
  which is included in Rails, but I wanted a version that ran in a pure Ruby environment, using only
18
- Test::Unit.
18
+ Test::Unit, which I prefer over Minitest, mainly because the latter uses notifications that don't
19
+ work especially well with Emacs, such as changing the mode line to show the success/failure status,
20
+ but do not afterward change back to the default settings.
19
21
 
20
22
  Ergo, paramesan, which as of this writing, allows a very primitive set of options for parameterized
21
23
  tests.
@@ -24,6 +26,8 @@ tests.
24
26
 
25
27
  ## Before
26
28
 
29
+ 31 lines.
30
+
27
31
  ```ruby
28
32
  require 'pvn/log/options'
29
33
  require 'test/unit'
@@ -60,6 +64,8 @@ end
60
64
 
61
65
  ## After
62
66
 
67
+ 20 lines, 35% fewer.
68
+
63
69
  ```ruby
64
70
  require 'pvn/log/options'
65
71
  require 'test/unit'
@@ -4,22 +4,30 @@
4
4
  require "paramesan/version"
5
5
 
6
6
  module Paramesan
7
- def param_test paramlist, &blk
8
- puts "self: #{self}"
9
-
10
- paramlist.each do |params|
11
- basename = "test_" + params.to_s.gsub(Regexp.new('[^\w]+'), '_')
12
- mname = basename
7
+ module ClassMethods
8
+ def param_test paramlist, &blk
9
+ puts "self: #{self}"
10
+
11
+ paramlist.each do |params|
12
+ basename = "test_" + params.to_s.gsub(Regexp.new('[^\w]+'), '_')
13
+ mname = basename
13
14
 
14
- count = 1
15
- while instance_methods.include? mname.to_sym
16
- mname += "_#{count}"
17
- end
15
+ count = 1
16
+ while instance_methods.include? mname.to_sym
17
+ mname += "_#{count}"
18
+ end
18
19
 
19
- define_method mname do
20
- instance_exec(params, &blk)
21
- puts
20
+ define_method mname do
21
+ instance_exec(params, &blk)
22
+ puts
23
+ end
22
24
  end
23
25
  end
24
26
  end
27
+
28
+ extend ClassMethods
29
+
30
+ def self.included other
31
+ other.extend ClassMethods
32
+ end
25
33
  end
@@ -4,5 +4,5 @@
4
4
  require 'pathname'
5
5
 
6
6
  module Paramesan
7
- VERSION = "0.0.1"
7
+ VERSION = "0.0.2"
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paramesan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Pace
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-08 00:00:00.000000000 Z
11
+ date: 2017-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler