sauron 0.1.24 → 0.1.26
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.
- data/VERSION +1 -1
- data/generators/sauron/templates/sauron_watchr.rb +3 -2
- data/lib/sauron/sauron_template.rb +11 -0
- data/sauron.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.26
|
@@ -3,16 +3,17 @@ require 'lib/sauron/watchr'
|
|
3
3
|
case Sauron.framework
|
4
4
|
when 'testunit'
|
5
5
|
# Unit tests #
|
6
|
-
watch('test/unit
|
6
|
+
watch('test/unit/(.*)_test\.rb'){|f| Sauron.run_pattern_tests 'test/unit/', f[1], '_test.rb'}
|
7
7
|
watch('app/models/(.*)\.rb'){|f| Sauron.run_single_test "test/unit/#{f[1]}_test.rb"}
|
8
8
|
|
9
9
|
# Functional tests #
|
10
|
-
watch('test/functional
|
10
|
+
watch('test/functional/(.*)_controller_test\.rb'){|f| Sauron.run_pattern_tests 'test/functional/', f[1], '_controller_test.rb'}
|
11
11
|
watch('app/controllers/(.*)\.rb'){|f| Sauron.run_single_test "test/functional/#{f[1]}_test.rb"}
|
12
12
|
watch('app/views/(.*)/.*\.html.erb'){|f| Sauron.run_single_test "test/functional/#{f[1]}_controller_test.rb"}
|
13
13
|
|
14
14
|
# Routing tests #
|
15
15
|
watch('config/routes.rb'){|f| Sauron.run_routing_tests }
|
16
|
+
watch('test/unit/rout(ing|es)_test.rb'){|f| Sauron.run_routing_tests }
|
16
17
|
|
17
18
|
# Multiple tests #
|
18
19
|
watch('test/test_helper.rb'){|f| Sauron.run_all_tests }
|
@@ -40,6 +40,17 @@ class SauronTemplate
|
|
40
40
|
system "time ruby script/spec -O spec/spec.opts #{file}"
|
41
41
|
end
|
42
42
|
end
|
43
|
+
|
44
|
+
def run_pattern_tests prefix, pattern, suffix
|
45
|
+
files = []
|
46
|
+
|
47
|
+
elements = pattern.split(/_/)
|
48
|
+
while elements.shift
|
49
|
+
files << Dir.glob("#{prefix}#{elements.join('_')}#{suffix}") unless elements.empty?
|
50
|
+
end
|
51
|
+
|
52
|
+
run_multiple_tests files
|
53
|
+
end
|
43
54
|
|
44
55
|
def run_multiple_tests *files
|
45
56
|
joined_files = files.join(',')
|
data/sauron.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sauron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 47
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 26
|
10
|
+
version: 0.1.26
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Bellmyer
|