Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nachojorge committed Dec 19, 2024
1 parent f9824e0 commit bb09bd2
Show file tree
Hide file tree
Showing 24 changed files with 185 additions and 161 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ruby:2.5.0

WORKDIR /home/angus-sdoc

COPY . ./

RUN bundle install

CMD ["/bin/bash"]
15 changes: 8 additions & 7 deletions angus-sdoc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ Gem::Specification.new do |spec|
spec.require_paths = %w[lib]

spec.add_development_dependency('rake')
spec.add_development_dependency('yard', '0.8.7')
spec.add_development_dependency('rspec', '~> 2.12')
spec.add_development_dependency('factory_girl')
spec.add_development_dependency('yard')
spec.add_development_dependency('rspec')
spec.add_development_dependency('rspec-its')
spec.add_development_dependency('factory_bot', '!= 6.4.5')
spec.add_development_dependency('json_expressions')
spec.add_development_dependency('simplecov', '0.7.1')
spec.add_development_dependency('simplecov-rcov', '0.2.3')
spec.add_development_dependency('simplecov-rcov-text', '0.0.2')
spec.add_development_dependency('simplecov')
spec.add_development_dependency('simplecov-rcov')
spec.add_development_dependency('simplecov-rcov-text')
spec.add_development_dependency('ci_reporter')
end
end
8 changes: 8 additions & 0 deletions bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

docker build -t angus-sdoc .

(docker stop angus-sdoc) || true
(docker rm angus-sdoc) || true

docker run -it --name angus-sdoc -v ${PWD}:/home/angus-sdoc angus-sdoc bash
20 changes: 10 additions & 10 deletions spec/angus/definitions/glossary_term_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,44 @@
include JsonRepresentations::GlossaryTerms

describe 'attributes' do
it { should have_attribute(:short_name) }
it { should have_attribute(:long_name) }
it { should have_attribute(:description) }
it { is_expected.to have_attribute(:short_name) }
it { is_expected.to have_attribute(:long_name) }
it { is_expected.to have_attribute(:description) }
end

subject(:glossary_term) { FactoryGirl.build(:glossary_term) }
subject(:glossary_term) { FactoryBot.build(:glossary_term) }

describe '#==' do
let(:other) { subject.dup }

it { should_not eq(Object.new)}
it { is_expected.not_to eq(Object.new)}

it { should eq(other)}
it { is_expected.to eq(other)}

it 'returns false if have different short names' do
other.short_name = "#{glossary_term.short_name}--"

subject.should_not eq(other)
is_expected.not_to eq(other)
end

it 'returns false if have different long names' do
other.long_name = "#{glossary_term.long_name}--"

subject.should_not eq(other)
is_expected.not_to eq(other)
end

it 'returns false if have different descriptions' do
other.description = "#{glossary_term.description}--"

subject.should_not eq(other)
is_expected.not_to eq(other)
end

it 'returns true when the have the same attributes' do
other_object = Angus::SDoc::Definitions::GlossaryTerm.new(glossary_term.short_name,
glossary_term.long_name,
glossary_term.description)

subject.should eq(other_object)
is_expected.to eq(other_object)
end

end
Expand Down
28 changes: 14 additions & 14 deletions spec/angus/definitions/operation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ module Angus::SDoc::Definitions
include JsonRepresentations::Operations

describe 'attributes' do
it { should have_attribute(:name) }
it { should have_attribute(:code_name) }
it { should have_attribute(:description) }
it { should have_attribute(:path) }
it { should have_attribute(:http_method) }
it { is_expected.to have_attribute(:name) }
it { is_expected.to have_attribute(:code_name) }
it { is_expected.to have_attribute(:description) }
it { is_expected.to have_attribute(:path) }
it { is_expected.to have_attribute(:http_method) }

it { should have_attribute(:messages) }
it { is_expected.to have_attribute(:messages) }

it { should have_attribute(:uri_elements) }
it { should have_attribute(:request_elements) }
it { should have_attribute(:response_elements) }
it { is_expected.to have_attribute(:uri_elements) }
it { is_expected.to have_attribute(:request_elements) }
it { is_expected.to have_attribute(:response_elements) }
end

describe '#message' do
Expand All @@ -39,32 +39,32 @@ module Angus::SDoc::Definitions
it 'should return nil if messages array is nil' do
subject.messages = nil

subject.message('testing', Message::INFO_LEVEL).should be_nil
expect(subject.message('testing', Message::INFO_LEVEL)).to be_nil
end

# TODO Should this raise an exception instead of returning nil
it 'should return nil if message level is not allowed' do
subject.messages = [error_message, info_message]

subject.message('testing', 'strange-level').should be_nil
expect(subject.message('testing', 'strange-level')).to be_nil
end

it 'should return nil if message level is nil' do
subject.messages = [error_message, info_message]

subject.message('testing', nil).should be_nil
expect(subject.message('testing', nil)).to be_nil
end

it 'should return nil if message key is nil' do
subject.messages = [error_message, info_message]

subject.message(nil, Message::INFO_LEVEL).should be_nil
expect(subject.message(nil, Message::INFO_LEVEL)).to be_nil
end

it 'should return the message if the key and level matches' do
subject.messages = [error_message, info_message]

subject.message(error_message.key, error_message.level).should eq(error_message)
expect(subject.message(error_message.key, error_message.level)).to eq(error_message)
end

end
Expand Down
10 changes: 5 additions & 5 deletions spec/angus/definitions/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
it { should have_attribute(:glossary) }
end

pending '#message'
pending '#merge'
pending '#operation_definition'
pending '#proxy_operations_for'
pending '#representations_hash'
skip '#message'
skip '#merge'
skip '#operation_definition'
skip '#proxy_operations_for'
skip '#representations_hash'

end
45 changes: 22 additions & 23 deletions spec/angus/definitions_reader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@
subject { Angus::SDoc::DefinitionsReader.service_definition(base_path) }

context 'service' do
its(:name) { should eq('My Service') }
its(:code_name) { should eq('service') }
its(:version) { should eq('1.0') }
its(:name) { is_expected.to eq('My Service') }
its(:code_name) { is_expected.to eq('service') }
its(:version) { is_expected.to eq('1.0') }
end

pending 'proxy operations'
skip 'proxy operations'

context 'messages' do
it 'should correctly load messages' do
subject.messages.keys.should include('InvalidJsonError', 'UnauthorizedOperationError',
expect(subject.messages.keys).to include('InvalidJsonError', 'UnauthorizedOperationError',
'VerificationNotFoundError', 'BlankConfirmPathError')
end

it 'correctly loads a particular message (InvalidJsonError)' do
message = subject.messages['InvalidJsonError']

message.status_code.should == 422
message.level.should == 'error'
message.description.should == 'Invalid json.'
expect(message.status_code).to eq(422)
expect(message.level).to eq('error')
expect(message.description).to eq('Invalid json.')
end

it 'should correctly load a particular message (RollbackSuccessful)' do
message = subject.messages['RollbackSuccessful']

message.status_code.should eq(200)
message.level.should eq('info')
message.description.should eq('Rollback Successful.')
expect(message.status_code).to eq(200)
expect(message.level).to eq('info')
expect(message.description).to eq('Rollback Successful.')
end

describe 'errors' do
Expand Down Expand Up @@ -66,7 +66,7 @@
let(:rollback_payment_multi) { subject.representations.find { |rep| rep.name == 'rollback_payment_multi' } }

it 'correctly loads a particular representation' do
rollback_payment_multi.should_not be_nil # Should exists this representation
expect(rollback_payment_multi).not_to be_nil # Should exists this representation
end

it 'should correctly load it\'s fields' do
Expand All @@ -78,7 +78,7 @@
Angus::SDoc::Definitions::RepresentationField.new('token', 'Authorization token.', true, 'string')
]

rollback_payment_multi.fields.should == fields
expect(rollback_payment_multi.fields).to eq(fields)
end
end

Expand All @@ -88,25 +88,25 @@
let(:create_multi_buy) { subject.operation_definition(namespace, 'create_multi_buy') }

it 'correctly loads a particular operation' do
create_multi_buy.should_not be_nil
expect(create_multi_buy).not_to be_nil
end

it 'correctly loads it\'s name' do
create_multi_buy.name.should eq('Create multi-item buy.')
expect(create_multi_buy.name).to eq('Create multi-item buy.')
end

it 'correctly loads it\'s description' do
description = 'Begins buy process.'

create_multi_buy.description.should include(description)
expect(create_multi_buy.description).to include(description)
end

it 'correctly loads it\'s path' do
create_multi_buy.path.should eq('/multi_buy')
expect(create_multi_buy.path).to eq('/multi_buy')
end

it 'correctly loads it\'s method' do
create_multi_buy.http_method.should eq('post')
expect(create_multi_buy.http_method).to eq('post')
end

it 'correctly loads it\'s requests' do
Expand All @@ -115,16 +115,15 @@
Angus::SDoc::Definitions::RequestElement.new('operation', 'Operation Data', true, 'multi_buy'),
]

create_multi_buy.request_elements.should eq(request_elements)
expect(create_multi_buy.request_elements).to eq(request_elements)
end

pending 'messages'
skip 'messages'

pending 'response'
skip 'response'
end

pending 'glossary'

skip 'glossary'
end

end
2 changes: 1 addition & 1 deletion spec/angus/sdoc/html_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

describe '.format_service' do

let(:service) { FactoryGirl.build(:full_service) }
let(:service) { FactoryBot.build(:full_service) }

context 'when "en" language' do
subject { formatter.format_service(service, 'en') }
Expand Down
Loading

0 comments on commit bb09bd2

Please sign in to comment.