test_console 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,13 +12,16 @@ module TestConsole
12
12
 
13
13
  WATCH_PATHS.each do |p|
14
14
  watch_folder = File.join(Rails.root.to_s, p)
15
- Dir.glob(File.join(watch_folder, '**', '*.*rb')).each do |f|
15
+ Dir.glob(File.join('..', p, '**', '*.*rb')).each do |f|
16
16
  if File.mtime(f) > @last_reload_time
17
- rel_path = f[watch_folder.length+1..-1]
17
+ abs_path = File.join(Dir.pwd, f)
18
+ rel_path = f.gsub /#{Rails.root.to_s}/, ''
19
+ rel_path = rel_path.gsub /..\//, ''
20
+ rel_path = rel_path.gsub /#{p}\//, ''
18
21
  TestConsole.out "Reloading #{rel_path}", :cyan
19
22
  klass = Utility.class_from_filename(rel_path)
20
- const_remove(klass) if const_defined?(klass)
21
- load f
23
+ Utility.const_remove(klass) if Utility.const_defined?(klass)
24
+ load abs_path
22
25
  end
23
26
  end
24
27
  end
@@ -32,8 +35,8 @@ module TestConsole
32
35
  return false if @last_init_time.nil?
33
36
 
34
37
  STOP_FOLDERS.each do |p|
35
- watch_folder = File.join(Rails.root.to_s, p)
36
- Dir.glob(File.join(watch_folder, '**', '*.{rb,yml}')).each do |f|
38
+ #watch_folder = File.join(Rails.root.to_s, p)
39
+ Dir.glob(File.join('..', p, '**', '*.{rb,yml}')).each do |f|
37
40
  if File.mtime(f) > @last_init_time
38
41
  error "#{f} has been changed.\nYou will need to restart the console to reload the environment"
39
42
  return true
@@ -15,7 +15,7 @@ module TestConsole
15
15
 
16
16
  # drop the test folder
17
17
  segs = segs[1..-1] while segs[0] == 'test'
18
-
18
+ segs = segs[1..-1] while ['unit', 'functional', 'helpers', 'integration'].include?(segs[0])
19
19
  ret = segs.map {|seg| seg.camelize}
20
20
 
21
21
  return ret
@@ -1,3 +1,3 @@
1
1
  module TestConsole
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,27 @@
1
+ Connecting to database specified by database.yml
2
+  (0.0ms) begin transaction
3
+  (0.0ms) rollback transaction
4
+  (0.0ms) begin transaction
5
+  (0.0ms) rollback transaction
6
+  (0.0ms) begin transaction
7
+  (0.0ms) rollback transaction
8
+  (0.0ms) begin transaction
9
+  (0.0ms) rollback transaction
10
+  (0.0ms) begin transaction
11
+  (0.0ms) rollback transaction
12
+  (0.0ms) begin transaction
13
+  (0.0ms) rollback transaction
14
+  (0.0ms) begin transaction
15
+  (0.0ms) rollback transaction
16
+  (0.0ms) begin transaction
17
+  (0.0ms) rollback transaction
18
+  (0.0ms) begin transaction
19
+  (0.0ms) rollback transaction
20
+  (0.0ms) begin transaction
21
+  (0.0ms) rollback transaction
22
+  (0.0ms) begin transaction
23
+  (0.0ms) rollback transaction
24
+  (0.0ms) begin transaction
25
+  (0.0ms) rollback transaction
26
+  (0.0ms) begin transaction
27
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_console
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Phillips
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-07-12 00:00:00 Z
18
+ date: 2012-07-15 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  prerelease: false
@@ -74,6 +74,20 @@ dependencies:
74
74
  requirement: *id004
75
75
  name: sqlite3
76
76
  type: :development
77
+ - !ruby/object:Gem::Dependency
78
+ prerelease: false
79
+ version_requirements: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ hash: 3
85
+ segments:
86
+ - 0
87
+ version: "0"
88
+ requirement: *id005
89
+ name: ruby-debug
90
+ type: :development
77
91
  description: Console for testing Rails applications with TestUnit.
78
92
  email:
79
93
  - adam@indivisible.org.uk