testowl 0.0.5 → 0.0.6

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.
@@ -29,6 +29,11 @@ module Testowl
29
29
  puts "Detected change in #{match[0]}"
30
30
  run_model(match[1], "triggered by #{match[0]}")
31
31
  end
32
+ # Watch controllers
33
+ script.watch("app/controllers/(.*)_controller\.rb") do |match|
34
+ puts "Detected change in #{match[0]}"
35
+ run_controller(match[1], "triggered by #{match[0]}")
36
+ end
32
37
  puts "Monitoring files..."
33
38
  Watchr::Controller.new(script, Watchr.handler.new).run
34
39
  end
@@ -46,6 +51,12 @@ module Testowl
46
51
  tester.run
47
52
  end
48
53
 
54
+ def run_controller(controller_name, reason)
55
+ tester = Tester.new(@runner, reason)
56
+ tester.add Dir["#{test_dir}/**/#{controller_name}_controller_#{test_suffix}.rb"]
57
+ tester.run
58
+ end
59
+
49
60
  def tests_for_model(model)
50
61
  tests = []
51
62
  tests += Dir["#{test_dir}/**/#{model.pluralize}_controller_#{test_suffix}.rb"]
@@ -3,7 +3,7 @@ module Testowl
3
3
 
4
4
  def run(files)
5
5
  results = runDirectly(files)
6
- lines = results.output.split("\n")
6
+ lines = results.split("\n")
7
7
  exception_message = lines.detect{|line| line =~ /^Exception encountered/ }
8
8
  counts = lines.detect{|line| line =~ /(\d+)\sexamples?,\s(\d+)\sfailures?/ }
9
9
  if counts
@@ -1,3 +1,3 @@
1
1
  module Testowl
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testowl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bill Horsman
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-22 00:00:00 -07:00
18
+ date: 2011-06-24 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency