Skip to content
This repository was archived by the owner on Dec 8, 2017. It is now read-only.

Commit b08a0da

Browse files
committed
Add Travis support
* Don't run integration tests if CONNECT_VBMS_KEYFILE isn't present * Add default rake task to build java and run spec * Add .travis.yml Closes #6 Closes #10 Thanks @amoose for figuring out jruby and reviewing the rest
1 parent 9b55253 commit b08a0da

File tree

6 files changed

+34
-7
lines changed

6 files changed

+34
-7
lines changed

.travis.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
language: ruby
2+
cache: bundler
3+
4+
matrix:
5+
include:
6+
- rvm: 2.1.0
7+
before_install: gem install bundler --no-ri --no-rdoc
8+
- rvm: 2.2.2
9+
before_install: gem install bundler --no-ri --no-rdoc
10+
- rvm: jruby-1.7.20
11+
before_install: gem install bundler --no-ri --no-rdoc
12+
before_script: export JRUBY_OPTS="$JRUBY_OPTS --2.0"
13+
fast_finish: true

Rakefile

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
require 'bundler/gem_tasks'
2+
require 'rspec/core/rake_task'
3+
4+
RSpec::Core::RakeTask.new(:spec)
5+
6+
task default: [:build_java, :spec]
27

38
task :build_java do
49
sh "make -C src build"

connect_vbms.gemspec

-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ Gem::Specification.new do |spec|
2828

2929
spec.add_development_dependency "bundler", "~> 1.10"
3030
spec.add_development_dependency "rake", "~> 10.0"
31-
spec.add_development_dependency "byebug", "~> 5"
3231
spec.add_development_dependency "rspec", "~> 3.3"
33-
spec.add_development_dependency "pry-nav", "~> 0.2"
3432
spec.add_development_dependency "equivalent-xml", "~> 0.6"
3533

3634
spec.add_runtime_dependency "httpi", "~> 2.4"

spec/ruby_crypto_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
end
3131

3232
it "encrypts in java, and decrypts using ruby" do
33+
if RUBY_PLATFORM=="java"
34+
pending("This spec fails in jruby")
35+
end
36+
3337
encrypted_xml = VBMS.encrypted_soap_document(
3438
plaintext_xml, test_jks_keystore, test_keystore_pass, plaintext_request_name)
3539
decrypted_xml = VBMS.decrypt_message_xml_ruby(encrypted_xml, test_pc12_server_key,

spec/spec_helper.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
# encoding: utf-8
2+
13
# TODO: remove this once we can put our source code in `lib/`
24
$LOAD_PATH << File.join(File.dirname(__FILE__), "..", "src")
35

46
require 'vbms'
57
require 'nokogiri'
6-
require 'byebug'
78
require 'rspec/matchers'
89
require 'equivalent-xml'
910

@@ -34,4 +35,10 @@ def fixture(path)
3435
# get run.
3536
config.filter_run :focus
3637
config.run_all_when_everything_filtered = true
38+
39+
# If CONNECT_VBMS_KEYFILE is not set, don't run the integration tests
40+
if !ENV.has_key? "CONNECT_VBMS_KEYFILE"
41+
puts "¡¡¡ CONNECT_VBMS_KEYFILE is not set, not running integration tests!!!"
42+
config.filter_run_excluding integration: true
43+
end
3744
end

spec/vbms_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
@client = VBMS::Client.from_env_vars()
148148
end
149149

150-
describe "UploadDocumentWithAssociations" do
150+
describe "UploadDocumentWithAssociations", integration: true do
151151
it "executes succesfully when pointed at VBMS" do
152152
Tempfile.open("tmp") do |t|
153153
request = VBMS::Requests::UploadDocumentWithAssociations.new(
@@ -169,15 +169,15 @@
169169
end
170170

171171
describe "ListDocuments" do
172-
it "executes succesfully when pointed at VBMS" do
172+
it "executes succesfully when pointed at VBMS", integration: true do
173173
request = VBMS::Requests::ListDocuments.new("784449089")
174174

175175
@client.send(request)
176176
end
177177
end
178178

179179
describe "FetchDocumentById" do
180-
it "executes succesfully when pointed at VBMS" do
180+
it "executes succesfully when pointed at VBMS", integration: true do
181181
# Use ListDocuments to find a document to fetch
182182
request = VBMS::Requests::ListDocuments.new("784449089")
183183
result = @client.send(request)
@@ -188,7 +188,7 @@
188188
end
189189

190190
describe "GetDocumentTypes" do
191-
it "executes succesfully when pointed at VBMS" do
191+
it "executes succesfully when pointed at VBMS", integration: true do
192192
request = VBMS::Requests::GetDocumentTypes.new()
193193
result = @client.send(request)
194194

0 commit comments

Comments
 (0)