Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

DRY'ed up test dir with test_helper.rb file

  • Loading branch information...
commit 2a42446d52c2206b82399c9c2b969b878fb347a4 1 parent 0d5f284
Glenn Rempe grempe authored
2  .gitignore
View
@@ -1,3 +1,3 @@
pkg/*
doc/*
-
+coverage/*
4 stomp.gemspec
View
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
# get this easily and accurately by running 'Dir.glob("{lib,test}/**/*")'
# in an IRB session. However, GitHub won't allow that command hence
# we spell it out.
- s.files = ["README.rdoc", "LICENSE", "CHANGELOG", "Rakefile", "lib/stomp.rb", "lib/stomp/client.rb", "lib/stomp/connection.rb", "lib/stomp/message.rb", "test/test_client.rb", "test/test_stomp.rb", "test/test_url_connections.rb", "test/test_url_connections_noauth.rb"]
- s.test_files = ["test/test_client.rb", "test/test_stomp.rb", "test/test_url_connections.rb", "test/test_url_connections_noauth.rb"]
+ s.files = ["README.rdoc", "LICENSE", "CHANGELOG", "Rakefile", "lib/stomp.rb", "lib/stomp/client.rb", "lib/stomp/connection.rb", "lib/stomp/message.rb", "test/test_client.rb", "test/test_connection.rb", "test/test_helper.rb", "test/test_url_connections.rb", "test/test_url_connections_noauth.rb"]
+ s.test_files = ["test/test_client.rb", "test/test_connection.rb", "test/test_helper.rb", "test/test_url_connections.rb", "test/test_url_connections_noauth.rb"]
s.has_rdoc = true
s.rdoc_options = ["--quiet", "--title", "stomp documentation", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc", "--inline-source"]
20 test/test_client.rb
View
@@ -1,21 +1,4 @@
-# Copyright 2005-2006 Brian McCallister
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'test/unit'
-require 'timeout'
-require 'stomp'
+require File.join(File.dirname(__FILE__), 'test_helper.rb')
class TestClient < Test::Unit::TestCase
@@ -194,4 +177,5 @@ def test_transaction_with_client_side_redelivery
@client.acknowledge message, :transaction => 'tx2'
@client.commit 'tx2'
end
+
end
20 test/test_stomp.rb → test/test_connection.rb
View
@@ -1,20 +1,4 @@
-# Copyright 2005-2006 Brian McCallister
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'test/unit'
-require 'stomp'
+require File.join(File.dirname(__FILE__), 'test_helper.rb')
class TestStomp < Test::Unit::TestCase
@@ -68,7 +52,6 @@ def test_receipt
assert_equal "abc", msg.headers['receipt-id']
end
-
def test_client_ack_with_symbol
@conn.subscribe make_destination, :ack => :client
@conn.send make_destination, "test_stomp#test_client_ack_with_symbol"
@@ -82,4 +65,5 @@ def test_embedded_null
msg = @conn.receive
assert_equal "a\0" , msg.body
end
+
end
5 test/test_helper.rb
View
@@ -0,0 +1,5 @@
+require 'test/unit'
+require 'timeout'
+require 'stomp'
+$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
+
20 test/test_url_connections.rb
View
@@ -1,21 +1,4 @@
-# Copyright 2005-2006 Brian McCallister
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'test/unit'
-require 'timeout'
-require 'stomp'
+require File.join(File.dirname(__FILE__), 'test_helper.rb')
class TestClient < Test::Unit::TestCase
@@ -194,4 +177,5 @@ def test_transaction_with_client_side_redelivery
@client.acknowledge message, :transaction => 'tx2'
@client.commit 'tx2'
end
+
end
20 test/test_url_connections_noauth.rb
View
@@ -1,21 +1,4 @@
-# Copyright 2005-2006 Brian McCallister
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
-require 'test/unit'
-require 'timeout'
-require 'stomp'
+require File.join(File.dirname(__FILE__), 'test_helper.rb')
class TestClient < Test::Unit::TestCase
@@ -194,4 +177,5 @@ def test_transaction_with_client_side_redelivery
@client.acknowledge message, :transaction => 'tx2'
@client.commit 'tx2'
end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.