Skip to content

Commit

Permalink
add rubocop rake tasks; add coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Nov 1, 2016
1 parent 1c17b49 commit 5360968
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ config/certs
.rvmrc
.bundle
.ruby-*
coverage/*
workflow_service.log*
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ end

group :test, :development do
gem 'rspec'
gem 'coveralls', require: false
gem 'simplecov'
gem 'equivalent-xml'
gem 'fakeweb'
gem 'rack-console'
gem 'rubocop'
gem 'rubocop-rspec'
end

group :deployment do
Expand Down
27 changes: 27 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
ast (2.3.0)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
Expand Down Expand Up @@ -50,6 +51,12 @@ GEM
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
confstruct (0.2.7)
coveralls (0.8.12)
json (~> 1.8)
simplecov (~> 0.11.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
tins (~> 1.6.0)
daemons (1.2.4)
deprecation (1.0.0)
activesupport
Expand Down Expand Up @@ -182,6 +189,9 @@ GEM
activesupport
nokogiri (>= 1.4.2)
solrizer (~> 3.3)
parser (2.3.1.4)
ast (~> 2.2)
powerpack (0.1.1)
rack (1.6.4)
rack-accept (0.4.5)
rack (>= 0.4)
Expand All @@ -192,6 +202,7 @@ GEM
rack (>= 1.0.0)
rack-test (0.6.3)
rack (>= 1.0)
rainbow (2.1.0)
rake (10.5.0)
rdf (1.99.1)
link_header (~> 0.0, >= 0.0.8)
Expand Down Expand Up @@ -235,9 +246,18 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
rubocop (0.44.1)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
rubocop-rspec (1.8.0)
rubocop (>= 0.42.0)
ruby-cache (0.3.0)
ruby-graphviz (1.2.2)
ruby-oci8 (2.2.1)
ruby-progressbar (1.8.1)
rubydora (1.9.0)
activemodel
activesupport
Expand Down Expand Up @@ -268,15 +288,19 @@ GEM
mods (~> 2.0, >= 2.0.2)
stomp (1.4.3)
systemu (2.6.5)
term-ansicolor (1.4.0)
tins (~> 1.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
tins (1.6.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.15)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.1.1)
uuidtools (2.1.5)
validatable (1.6.7)
virtus (1.0.5)
Expand All @@ -299,6 +323,7 @@ DEPENDENCIES
capistrano
capistrano-bundler
capistrano-passenger
coveralls
dlss-capistrano
dor-services (~> 5.12)
equivalent-xml
Expand All @@ -310,6 +335,8 @@ DEPENDENCIES
rack-test
rest-client
rspec
rubocop
rubocop-rspec
ruby-oci8
simplecov
workflow-archiver (~> 2.0)
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/sul-dlss/dor-services-app.png?branch=master)](https://travis-ci.org/sul-dlss/dor-services-app)
[![Build Status](https://travis-ci.org/sul-dlss/dor-services-app.png?branch=master)](https://travis-ci.org/sul-dlss/dor-services-app)
[![Coverage Status](https://coveralls.io/repos/github/sul-dlss/dor-services-app/badge.svg?branch=master)](https://coveralls.io/github/sul-dlss/dor-services-app?branch=master)

# DOR Services App

Expand Down Expand Up @@ -43,6 +44,10 @@ You should now be ready to run `bundle install`. Note that DOR Services App requ
To run the tests:

`bundle exec rake`

To run rubocop (not autorun with tests):

`bundle exec rake rubocop`

## Console

Expand Down
3 changes: 1 addition & 2 deletions lib/goobi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ def register
end

with_retries(max_tries: Dor::Config.goobi.max_tries, handler: handler, base_sleep_seconds: Dor::Config.goobi.base_sleep_seconds, max_sleep_seconds: Dor::Config.goobi.max_sleep_seconds) do |_attempt|

url = "#{Dor::Config.goobi.url}"
response = RestClient.post url, xml_request, :content_type => :xml, :accept=>:xml
response = RestClient.post url, xml_request, :content_type => 'text/xml'
response.code
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/tasks/rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ begin
task :default => [:spec]
rescue LoadError
end

require 'rubocop/rake_task'

RuboCop::RakeTask.new
11 changes: 10 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
require 'simplecov'
require 'coveralls'
require 'fakeweb'
Coveralls.wear!

require File.expand_path(File.dirname(__FILE__) + '/../config/boot')

RSpec.configure do |conf|
conf.include Rack::Test::Methods
conf.order = 'random'
end

require 'fakeweb'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
])

TEST_WORKSPACE = (Dor::Config.stacks.local_workspace_root = 'tmp/dor/workspace')

Expand Down

0 comments on commit 5360968

Please sign in to comment.