torquespec 0.3.9.i → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ module TorqueSpec
14
14
  end
15
15
 
16
16
  def shutdown
17
- domain_api( :operation => "shutdown" )
17
+ api( :operation => "shutdown" )
18
18
  rescue EOFError
19
19
  # ignorable
20
20
  end
@@ -22,30 +22,30 @@ module TorqueSpec
22
22
  def _deploy(path)
23
23
  once = true
24
24
  begin
25
- domain_api( :operation => "add",
26
- :address => [ "deployment", addressify(path) ],
27
- :content => [ { :url=>urlify(path)} ] )
28
- rescue Exception=>e
25
+ api( :operation => "add",
26
+ :address => [ "deployment", addressify(path) ],
27
+ :content => [ { :url=>urlify(path)} ] )
28
+ rescue Exception
29
29
  _undeploy(path)
30
30
  if once
31
31
  once = false
32
32
  retry
33
33
  else
34
- raise e
34
+ raise
35
35
  end
36
36
  end
37
- domain_api( :operation => "deploy",
38
- :address => [ "deployment", addressify(path) ] )
37
+ api( :operation => "deploy",
38
+ :address => [ "deployment", addressify(path) ] )
39
39
  end
40
40
 
41
41
  def _undeploy(path)
42
- domain_api( :operation => "remove",
43
- :address => [ "deployment", addressify(path) ] )
42
+ api( :operation => "remove",
43
+ :address => [ "deployment", addressify(path) ] )
44
44
  end
45
45
 
46
46
  def ready?
47
- response = JSON.parse( domain_api( :operation => "read-attribute",
48
- :name => "server-state") )
47
+ response = JSON.parse( api( :operation => "read-attribute",
48
+ :name => "server-state") )
49
49
  response['outcome'].downcase=='success' && response['result'].downcase=='running'
50
50
  rescue
51
51
  false
@@ -53,12 +53,13 @@ module TorqueSpec
53
53
 
54
54
  private
55
55
 
56
- def domain_api(params)
56
+ def api(params)
57
57
  post('/management', params.merge('json.pretty' => 1).to_json)
58
58
  end
59
59
 
60
60
  def urlify(path)
61
- URI.parse(path).scheme.nil? ? "file:#{path}" : path
61
+ uri = URI.parse(path)
62
+ uri.scheme.nil? || uri.scheme =~ /^[a-zA-Z]$/ ? "file:#{path}" : path
62
63
  end
63
64
 
64
65
  def addressify(path)
@@ -1,3 +1,3 @@
1
1
  module TorqueSpec
2
- VERSION = "0.3.9.i"
2
+ VERSION = "0.4.0"
3
3
  end
data/spec/empty_spec.rb CHANGED
@@ -4,7 +4,7 @@ remote_describe "in-container tests without a deploy call" do
4
4
 
5
5
  it "should work" do
6
6
  require 'torquebox/messaging/queue'
7
- queue = TorqueBox::Messaging::Queue.start('/queues/foo', :jndi => "")
7
+ queue = TorqueBox::Messaging::Queue.start('/queues/foo')
8
8
  queue.publish('bar')
9
9
  queue.receive.should == 'bar'
10
10
  queue.stop
data/spec/remote_spec.rb CHANGED
@@ -18,7 +18,7 @@ remote_describe "in-container tests" do
18
18
 
19
19
  it "should work" do
20
20
  require 'torquebox/messaging/queue'
21
- queue = TorqueBox::Messaging::Queue.start('/queues/foo', :jndi => "")
21
+ queue = TorqueBox::Messaging::Queue.start('/queues/foo')
22
22
  queue.publish('bar')
23
23
  queue.receive.should == 'bar'
24
24
  queue.stop
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torquespec
3
3
  version: !ruby/object:Gem::Version
4
- hash: 30
5
- prerelease: true
4
+ hash: 15
5
+ prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 9
10
- - i
11
- version: 0.3.9.i
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
12
11
  platform: ruby
13
12
  authors:
14
13
  - Jim Crossley
@@ -17,7 +16,7 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2011-06-28 00:00:00 -04:00
19
+ date: 2011-08-10 00:00:00 -04:00
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
@@ -104,14 +103,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
103
  required_rubygems_version: !ruby/object:Gem::Requirement
105
104
  none: false
106
105
  requirements:
107
- - - ">"
106
+ - - ">="
108
107
  - !ruby/object:Gem::Version
109
- hash: 25
108
+ hash: 3
110
109
  segments:
111
- - 1
112
- - 3
113
- - 1
114
- version: 1.3.1
110
+ - 0
111
+ version: "0"
115
112
  requirements: []
116
113
 
117
114
  rubyforge_project: torquespec