camping 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -9
- data/Rakefile +13 -1
- data/lib/camping/campguide.rb +14 -0
- data/lib/camping/commands.rb +139 -40
- data/lib/camping/gear/filters.rb +39 -39
- data/lib/camping/gear/kuddly.rb +0 -1
- data/lib/camping/gear/nancy.rb +0 -1
- data/lib/camping/{reloader.rb → loader.rb} +86 -16
- data/lib/camping/loads.rb +1 -1
- data/lib/camping/server.rb +4 -9
- data/lib/camping/session.rb +2 -2
- data/lib/camping/version.rb +1 -1
- data/lib/camping-unabridged.rb +3 -2
- data/lib/camping.rb +1 -1
- data/test/app_config.rb +2 -4
- data/test/app_generator.rb +82 -0
- data/test/app_inception.rb +7 -0
- data/test/app_loader.rb +53 -0
- data/test/app_sessions.rb +4 -4
- data/test/apps/loader/apps/donuts/controllers/index.rb +18 -0
- data/test/apps/loader/apps/donuts.rb +15 -0
- data/test/apps/loader/camp.rb +35 -0
- data/test/apps/reloader/config.ru +1 -1
- data/test/apps/reloader/reload_me.rb +0 -1
- data/test/apps/{reloader.rb → reloader/reloader.rb} +1 -2
- data/test/config_reloader.rb +78 -0
- data/test/reload_reloader.rb +81 -0
- data/test/test_helper.rb +42 -1
- metadata +13 -6
- data/test/app_reloader.rb +0 -69
data/test/app_reloader.rb
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'camping/reloader'
|
4
|
-
|
5
|
-
$counter = 0
|
6
|
-
|
7
|
-
module TestCaseReloader
|
8
|
-
def reloader
|
9
|
-
@reloader ||= Camping::Reloader.new(file)
|
10
|
-
end
|
11
|
-
|
12
|
-
def setup
|
13
|
-
super
|
14
|
-
reloader.reload!
|
15
|
-
assert Object.const_defined?(:Reloader), "Reloader didn't load app"
|
16
|
-
end
|
17
|
-
|
18
|
-
def teardown
|
19
|
-
super
|
20
|
-
assert Object.const_defined?(:Reloader), "Test removed app"
|
21
|
-
reloader.remove_apps
|
22
|
-
assert !Object.const_defined?(:Reloader), "Reloader didn't remove app"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class TestReloader < TestCase
|
27
|
-
include TestCaseReloader
|
28
|
-
BASE = File.expand_path('../apps/reloader', __FILE__)
|
29
|
-
|
30
|
-
def file; BASE + '.rb' end
|
31
|
-
|
32
|
-
def setup
|
33
|
-
$counter = 0
|
34
|
-
super
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_counter
|
38
|
-
assert_equal 1, $counter
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_forced_reload
|
42
|
-
reloader.reload!
|
43
|
-
assert_equal 2, $counter
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_mtime_reload
|
47
|
-
reloader.reload
|
48
|
-
assert_equal 1, $counter
|
49
|
-
|
50
|
-
FileUtils.touch(BASE + '.rb')
|
51
|
-
sleep 1
|
52
|
-
reloader.reload
|
53
|
-
assert_equal 2, $counter
|
54
|
-
|
55
|
-
FileUtils.touch(BASE + '/reload_me.rb')
|
56
|
-
sleep 1
|
57
|
-
reloader.reload
|
58
|
-
assert_equal 3, $counter
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
class TestConfigRu < TestReloader
|
63
|
-
BASE = File.expand_path('../apps/reloader', __FILE__)
|
64
|
-
def file; BASE + '/config.ru' end
|
65
|
-
|
66
|
-
def test_name
|
67
|
-
assert_equal Reloader, reloader.apps[:reloader]
|
68
|
-
end
|
69
|
-
end
|