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.
- checksums.yaml +4 -4
- data/lib/test_with_verbosity.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75bb8b7110c6822f8dd1d56b8d9e6661687055fe
|
4
|
+
data.tar.gz: 01057b6454d2dc28443e20f5b8ba4200e2021601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7938cbeec4ff82fc5cd4fa3bc34860eae5da1c75caddde6d260ac07ddff2d8391ee25e8fec102b9bd8adb9eebba704133fe4b99ef7e00bf99479036c35e398
|
7
|
+
data.tar.gz: 03df2e9f606fbe1b19c71f23840db3825cf11e42c9e9c7828eb39deb038f0bca55d05d1ff2be7d5652b9b652b7e9d0bcf92dd2c7f32937d19bbddbeb841a48d2
|
data/lib/test_with_verbosity.rb
CHANGED
@@ -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
|
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
|
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")
|