jakewendt-test_with_verbosity 0.0.2 → 0.0.3

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. checksums.yaml +4 -4
  2. data/lib/test_with_verbosity.rb +8 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db357c276871f0d9e45ad6c78e89d16b32967026
4
- data.tar.gz: 4b1309f750a5d0aeb1833ebff719eb0f4f127408
3
+ metadata.gz: 75bb8b7110c6822f8dd1d56b8d9e6661687055fe
4
+ data.tar.gz: 01057b6454d2dc28443e20f5b8ba4200e2021601
5
5
  SHA512:
6
- metadata.gz: e76935c02273942ded046967530510dc5c45822abbc09e83a3a77fade71cbdc5554657206a23624aaf81bb409f5bb037c761373430fa8112f4b3c0f8b2eafcf3
7
- data.tar.gz: 24a400dbedac181401cab6bcda1f473b7d7164c5a05c5456fac4b8d172e864ef115afccd2590e4630da03b37d8c867f35de2f2134792e112d44b91484ed2a685
6
+ metadata.gz: 1b7938cbeec4ff82fc5cd4fa3bc34860eae5da1c75caddde6d260ac07ddff2d8391ee25e8fec102b9bd8adb9eebba704133fe4b99ef7e00bf99479036c35e398
7
+ data.tar.gz: 03df2e9f606fbe1b19c71f23840db3825cf11e42c9e9c7828eb39deb038f0bca55d05d1ff2be7d5652b9b652b7e9d0bcf92dd2c7f32937d19bbddbeb841a48d2
@@ -17,7 +17,7 @@ module JakeWendt::TestWithVerbosity
17
17
  # activesupport-4.1.4/lib/active_support/testing/declarative.rb
18
18
  def test(name, &block)
19
19
  #test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
20
- test_name = "test_#{name.gsub(/\W+/,'_')}".to_sym # NEED THIS
20
+ test_name = "test_#{name.gsub(/\W/,'_')}".to_sym # NEED THIS
21
21
  defined = instance_method(test_name) rescue false
22
22
  raise "#{test_name} is already defined in #{self}" if defined
23
23
  if block_given?
@@ -38,9 +38,15 @@ module JakeWendt::TestWithVerbosity
38
38
  end
39
39
  end
40
40
 
41
+
42
+ # rails used \s+ and converted groups of whitespace to a single underscore
43
+ # I then used \W+ and converted groups of non-word chars to a single underscore
44
+
45
+ # NOW I use \W and converted non-word chars to a underscores (no more groups)
46
+
41
47
  def test_with_verbosity(name,&block)
42
48
  test_without_verbosity(name,&block)
43
- test_name = "test_#{name.gsub(/\W+/,'_')}".to_sym
49
+ test_name = "test_#{name.gsub(/\W/,'_')}".to_sym
44
50
  define_method("_#{test_name}_with_verbosity") do
45
51
  print "\n#{self.class.name.gsub(/Test$/,'').titleize} #{name}: "
46
52
  send("_#{test_name}_without_verbosity")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jakewendt-test_with_verbosity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - George 'Jake' Wendt