rtomcat 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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/lib/manager.rb CHANGED
@@ -15,6 +15,15 @@ class Tomcat::Manager
15
15
  check_response(resource('deploy', appname).put(file))
16
16
  end
17
17
 
18
+ def redeploy(appname, file)
19
+ begin
20
+ undeploy(appname)
21
+ rescue
22
+ end
23
+
24
+ deploy(appname, file)
25
+ end
26
+
18
27
  private
19
28
 
20
29
  def check_response(response)
data/rtomcat.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rtomcat}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Darrin Holst"]
data/test/manager_test.rb CHANGED
@@ -21,7 +21,7 @@ class ManagerTest < Test::Unit::TestCase
21
21
  end
22
22
 
23
23
  def test_deploy
24
- FakeWeb.register_uri(:put, deploy_url, :body => "OK - Undeployed application at context path /appname")
24
+ FakeWeb.register_uri(:put, deploy_url, :body => "OK - Deployed application at context path /appname")
25
25
  assert_nothing_raised { deploy }
26
26
  end
27
27
 
@@ -35,6 +35,18 @@ class ManagerTest < Test::Unit::TestCase
35
35
  assert_raises_with("http status code: 200, message: FAIL - some error") { deploy }
36
36
  end
37
37
 
38
+ def test_redeploy
39
+ FakeWeb.register_uri(:get, undeploy_url, :body => "OK - Undeployed application at context path /appname")
40
+ FakeWeb.register_uri(:put, deploy_url, :body => "OK - Deployed application at context path /appname")
41
+ assert_nothing_raised { redeploy }
42
+ end
43
+
44
+ def test_redeploy_ignores_undeploy_errors
45
+ FakeWeb.register_uri(:get, undeploy_url, :body => "FAIL - some error")
46
+ FakeWeb.register_uri(:put, deploy_url, :body => "OK - Deployed application at context path /appname")
47
+ assert_nothing_raised { redeploy }
48
+ end
49
+
38
50
  private
39
51
 
40
52
  def undeploy_url
@@ -53,6 +65,10 @@ class ManagerTest < Test::Unit::TestCase
53
65
  @manager.deploy('appname', "FakeWeb doesn't allow for put body interrogation right now, so this parameter doesn't matter")
54
66
  end
55
67
 
68
+ def redeploy
69
+ @manager.redeploy('appname', "Some bogus file content")
70
+ end
71
+
56
72
  def assert_raises_with(message)
57
73
  begin
58
74
  yield
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rtomcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darrin Holst