diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2a8b12e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ruby:3.3.0 + +WORKDIR /home/angus-sdoc + +COPY . ./ + +RUN bundle install + +CMD ["/bin/bash"] diff --git a/angus-sdoc.gemspec b/angus-sdoc.gemspec index a1ecc00..0afbabb 100644 --- a/angus-sdoc.gemspec +++ b/angus-sdoc.gemspec @@ -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 \ No newline at end of file +end diff --git a/bin/run b/bin/run new file mode 100755 index 0000000..2320abb --- /dev/null +++ b/bin/run @@ -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 diff --git a/lib/angus/sdoc/version.rb b/lib/angus/sdoc/version.rb index 35e696a..e4af00e 100644 --- a/lib/angus/sdoc/version.rb +++ b/lib/angus/sdoc/version.rb @@ -1,5 +1,5 @@ module Angus module SDoc - VERSION = '0.0.7' + VERSION = '0.0.8' end end diff --git a/spec/angus/definitions/glossary_term_spec.rb b/spec/angus/definitions/glossary_term_spec.rb index 72bcfa9..82863eb 100644 --- a/spec/angus/definitions/glossary_term_spec.rb +++ b/spec/angus/definitions/glossary_term_spec.rb @@ -6,36 +6,36 @@ 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 @@ -43,7 +43,7 @@ glossary_term.long_name, glossary_term.description) - subject.should eq(other_object) + is_expected.to eq(other_object) end end diff --git a/spec/angus/definitions/operation_spec.rb b/spec/angus/definitions/operation_spec.rb index 37ab9c6..cd6cdac 100644 --- a/spec/angus/definitions/operation_spec.rb +++ b/spec/angus/definitions/operation_spec.rb @@ -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 @@ -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 diff --git a/spec/angus/definitions/service_spec.rb b/spec/angus/definitions/service_spec.rb index 0644299..3795fa8 100644 --- a/spec/angus/definitions/service_spec.rb +++ b/spec/angus/definitions/service_spec.rb @@ -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 diff --git a/spec/angus/definitions_reader_spec.rb b/spec/angus/definitions_reader_spec.rb index 47a7712..4d57d01 100644 --- a/spec/angus/definitions_reader_spec.rb +++ b/spec/angus/definitions_reader_spec.rb @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/spec/angus/sdoc/html_formatter_spec.rb b/spec/angus/sdoc/html_formatter_spec.rb index 760c41d..79c4ba8 100644 --- a/spec/angus/sdoc/html_formatter_spec.rb +++ b/spec/angus/sdoc/html_formatter_spec.rb @@ -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') } diff --git a/spec/angus/sdoc/json_formatter_spec.rb b/spec/angus/sdoc/json_formatter_spec.rb index d677ab3..bd21d62 100644 --- a/spec/angus/sdoc/json_formatter_spec.rb +++ b/spec/angus/sdoc/json_formatter_spec.rb @@ -18,7 +18,7 @@ describe '.format_glossary' do include JsonRepresentations::Glossaries - let(:glossary) { FactoryGirl.build(:glossary) } + let(:glossary) { FactoryBot.build(:glossary) } subject { formatter.format_glossary(glossary) } @@ -29,7 +29,7 @@ describe '.format_glossary_term' do include JsonRepresentations::GlossaryTerms - let(:glossary_term) { FactoryGirl.build(:glossary_term) } + let(:glossary_term) { FactoryBot.build(:glossary_term) } subject { formatter.format_glossary_term(glossary_term) } @@ -40,7 +40,7 @@ describe '.format_message' do include JsonRepresentations::Messages - let(:message) { FactoryGirl.build(:message) } + let(:message) { FactoryBot.build(:message) } subject { formatter.format_message(message) } @@ -51,7 +51,7 @@ describe '.format_operation' do include JsonRepresentations::Operations - let(:operation) { FactoryGirl.build(:full_operation) } + let(:operation) { FactoryBot.build(:full_operation) } subject { formatter.format_operation(operation) } @@ -62,7 +62,7 @@ describe '.format_proxy_operation' do include JsonRepresentations::ProxyOperations - let(:proxy_operation) { FactoryGirl.build(:proxy_operation) } + let(:proxy_operation) { FactoryBot.build(:proxy_operation) } subject { formatter.format_proxy_operation(proxy_operation) } @@ -73,7 +73,7 @@ describe '.format_representation' do include JsonRepresentations::Representations - let(:representation) { FactoryGirl.build(:full_representation) } + let(:representation) { FactoryBot.build(:full_representation) } subject { formatter.format_representation(representation) } @@ -87,13 +87,13 @@ subject { formatter.format_representation_field(representation_field) } context 'when a single element representation' do - let(:representation_field) { FactoryGirl.build(:single_representation_field) } + let(:representation_field) { FactoryBot.build(:single_representation_field) } it { should match_json_expression(representation_field_representation(representation_field)) } end context 'when a list element representation' do - let(:representation_field) { FactoryGirl.build(:list_representation_field) } + let(:representation_field) { FactoryBot.build(:list_representation_field) } it { should match_json_expression(representation_field_representation(representation_field)) } end @@ -106,13 +106,13 @@ subject { formatter.format_request_element(request_element) } context 'when a single request element' do - let(:request_element) { FactoryGirl.build(:single_request_element) } + let(:request_element) { FactoryBot.build(:single_request_element) } it { should match_json_expression(request_element_representation(request_element)) } end context 'when a list request element' do - let(:request_element) { FactoryGirl.build(:list_request_element) } + let(:request_element) { FactoryBot.build(:list_request_element) } it { should match_json_expression(request_element_representation(request_element)) } end @@ -125,13 +125,13 @@ subject { formatter.format_response_element(response_element) } context 'when a single response element' do - let(:response_element) { FactoryGirl.build(:single_response_element) } + let(:response_element) { FactoryBot.build(:single_response_element) } it { should match_json_expression(response_element_representation(response_element)) } end context 'when a list response element' do - let(:response_element) { FactoryGirl.build(:single_response_element) } + let(:response_element) { FactoryBot.build(:single_response_element) } it { should match_json_expression(response_element_representation(response_element)) } end @@ -141,7 +141,7 @@ describe '.format_service' do include JsonRepresentations::Services - let(:service) { FactoryGirl.build(:full_service) } + let(:service) { FactoryBot.build(:full_service) } subject { formatter.format_service(service) } @@ -152,7 +152,7 @@ describe '.format_uri_element' do include JsonRepresentations::UriElements - let(:uri_element) { FactoryGirl.build(:uri_element) } + let(:uri_element) { FactoryBot.build(:uri_element) } subject { formatter.format_uri_element(uri_element) } diff --git a/spec/factories/glossaries.rb b/spec/factories/glossaries.rb index 540a8d3..87b9e50 100644 --- a/spec/factories/glossaries.rb +++ b/spec/factories/glossaries.rb @@ -1,7 +1,7 @@ -FactoryGirl.define do +FactoryBot.define do factory :glossary, :class => Angus::SDoc::Definitions::Glossary do - terms { [FactoryGirl.build(:glossary_term)] } + terms { [FactoryBot.build(:glossary_term)] } end end diff --git a/spec/factories/glossary_terms.rb b/spec/factories/glossary_terms.rb index 68e153d..b315b33 100644 --- a/spec/factories/glossary_terms.rb +++ b/spec/factories/glossary_terms.rb @@ -1,9 +1,9 @@ -FactoryGirl.define do +FactoryBot.define do factory :glossary_term, :class => Angus::SDoc::Definitions::GlossaryTerm do - short_name 'fic' - long_name 'financial_institution_code' - description 'Financial institution code' + short_name { 'fic' } + long_name { 'financial_institution_code' } + description { 'Financial institution code' } end end diff --git a/spec/factories/messages.rb b/spec/factories/messages.rb index 1970ffa..14853a1 100644 --- a/spec/factories/messages.rb +++ b/spec/factories/messages.rb @@ -1,11 +1,11 @@ -FactoryGirl.define do +FactoryBot.define do factory :message, :class => Angus::SDoc::Definitions::Message do - key 'QueryNotAllowedError' - level 'error' - status_code 409 - description 'The query operation is not permitted.' - text 'The query operation is not permitted.' + key { 'QueryNotAllowedError' } + level { 'error' } + status_code { 409 } + description { 'The query operation is not permitted.' } + text { 'The query operation is not permitted.' } end end diff --git a/spec/factories/operations.rb b/spec/factories/operations.rb index 39ba16a..9572558 100644 --- a/spec/factories/operations.rb +++ b/spec/factories/operations.rb @@ -1,17 +1,17 @@ -FactoryGirl.define do +FactoryBot.define do factory :operation, :class => Angus::SDoc::Definitions::Operation do - code_name 'get_users' - name 'Get users' - description 'Returns the users list' - path '/users' - http_method 'get' + code_name { 'get_users' } + name { 'Get users' } + description { 'Returns the users list' } + path { '/users' } + http_method { 'get' } factory :full_operation do - messages { [FactoryGirl.build(:message)] } - uri_elements { [FactoryGirl.build(:uri_element)] } - request_elements { [FactoryGirl.build(:list_request_element)] } - response_elements { [FactoryGirl.build(:list_response_element)] } + messages { [FactoryBot.build(:message)] } + uri_elements { [FactoryBot.build(:uri_element)] } + request_elements { [FactoryBot.build(:list_request_element)] } + response_elements { [FactoryBot.build(:list_response_element)] } end end diff --git a/spec/factories/proxy_operations.rb b/spec/factories/proxy_operations.rb index 021de68..2414689 100644 --- a/spec/factories/proxy_operations.rb +++ b/spec/factories/proxy_operations.rb @@ -1,10 +1,10 @@ -FactoryGirl.define do +FactoryBot.define do factory :proxy_operation, :class => Angus::SDoc::Definitions::ProxyOperation do - code_name 'get_users' - path 'Get user' - http_method 'get' - service_name 'auth' + code_name { 'get_users' } + path { 'Get user' } + http_method { 'get' } + service_name { 'auth' } end end diff --git a/spec/factories/representation_fields.rb b/spec/factories/representation_fields.rb index 45abf6c..1174455 100644 --- a/spec/factories/representation_fields.rb +++ b/spec/factories/representation_fields.rb @@ -1,18 +1,19 @@ -FactoryGirl.define do +FactoryBot.define do factory :representation_field, :class => Angus::SDoc::Definitions::RepresentationField do factory :single_representation_field do - name 'user_id' - description 'The user identifier' - required true - type 'integer' + name { 'user_id' } + description { 'The user identifier' } + required { true } + type { 'integer' } + optional { false } end factory :list_representation_field do - name 'user_ids' - description 'The users identifiers' - required true - elements_type 'integer' + name { 'user_ids' } + description { 'The users identifiers' } + required { true } + elements_type { 'integer' } end end diff --git a/spec/factories/representations.rb b/spec/factories/representations.rb index e13ff75..5d96931 100644 --- a/spec/factories/representations.rb +++ b/spec/factories/representations.rb @@ -1,10 +1,10 @@ -FactoryGirl.define do +FactoryBot.define do factory :representation, :class => Angus::SDoc::Definitions::Representation do - name 'user' + name { 'user' } factory :full_representation do - fields { [FactoryGirl.build(:single_representation_field)] } + fields { [FactoryBot.build(:single_representation_field)] } end end diff --git a/spec/factories/request_elements.rb b/spec/factories/request_elements.rb index 13869ae..bddafd1 100644 --- a/spec/factories/request_elements.rb +++ b/spec/factories/request_elements.rb @@ -1,18 +1,19 @@ -FactoryGirl.define do +FactoryBot.define do factory :request_element, :class => Angus::SDoc::Definitions::RequestElement do factory :single_request_element do - name 'user' - description 'The user attributes' - required true - type 'user' + name { 'user' } + description { 'The user attributes' } + required { true } + type { 'user' } end factory :list_request_element do - name 'user_ids' - description 'The list users ids' - required true - elements_type 'integer' + name { 'user_ids' } + description { 'The list users ids' } + required { true } + elements_type { 'integer' } + optional { false } end end diff --git a/spec/factories/response_elements.rb b/spec/factories/response_elements.rb index cb8abd9..dbeda71 100644 --- a/spec/factories/response_elements.rb +++ b/spec/factories/response_elements.rb @@ -1,18 +1,20 @@ -FactoryGirl.define do +FactoryBot.define do factory :response_element, :class => Angus::SDoc::Definitions::ResponseElement do factory :single_response_element do - name 'user' - description 'The user attributes' - required true - type 'user' + name { 'user' } + description { 'The user attributes' } + required { true } + type { 'user' } + optional { false } end factory :list_response_element do - name 'users' - description 'The list of users' - required true - elements_type 'user' + name { 'users' } + description { 'The list of users' } + required { true } + elements_type { 'user' } + optional { false } end end diff --git a/spec/factories/services.rb b/spec/factories/services.rb index c4dd41f..0fa7d8b 100644 --- a/spec/factories/services.rb +++ b/spec/factories/services.rb @@ -1,18 +1,18 @@ -FactoryGirl.define do +FactoryBot.define do factory :service, :class => Angus::SDoc::Definitions::Service do - name 'Twotter' - code_name 'twotter' - version '0.1' + name { 'Twotter' } + code_name { 'twotter' } + version { '0.1' } factory :full_service do - representations { [FactoryGirl.build(:full_representation)] } - operations { [['users', [FactoryGirl.build(:full_operation)]]] } - proxy_operations { [FactoryGirl.build(:proxy_operation)] } - glossary { FactoryGirl.build(:glossary) } + representations { [FactoryBot.build(:full_representation)] } + operations { [['users', [FactoryBot.build(:full_operation)]]] } + proxy_operations { [FactoryBot.build(:proxy_operation)] } + glossary { FactoryBot.build(:glossary) } after(:build) do |service| - message = FactoryGirl.build(:message) + message = FactoryBot.build(:message) service.messages = { message.key => message} end @@ -20,4 +20,3 @@ end end - diff --git a/spec/factories/uri_elements.rb b/spec/factories/uri_elements.rb index c0ed084..e3b92ed 100644 --- a/spec/factories/uri_elements.rb +++ b/spec/factories/uri_elements.rb @@ -1,8 +1,8 @@ -FactoryGirl.define do +FactoryBot.define do factory :uri_element, :class => Angus::SDoc::Definitions::UriElement do - name 'user_id' - description 'The user identifier' + name { 'user_id' } + description { 'The user identifier' } end end diff --git a/spec/json_representations/representation_fields.rb b/spec/json_representations/representation_fields.rb index 415864f..08f5afa 100644 --- a/spec/json_representations/representation_fields.rb +++ b/spec/json_representations/representation_fields.rb @@ -3,15 +3,16 @@ module RepresentationFields def representation_field_representation(representation_field) representation = { - :field => representation_field.name, - :description => representation_field.description, - :required => representation_field.required + field: representation_field.name, + description: representation_field.description, + required: representation_field.required, + optional: representation_field.optional } - representation.merge!({:type => representation_field.type}) if representation_field.type + representation.merge!({ type: representation_field.type }) if representation_field.type if representation_field.elements_type - representation.merge!({:elements_type => representation_field.elements_type}) + representation.merge!({ elements_type: representation_field.elements_type }) end representation diff --git a/spec/json_representations/request_elements.rb b/spec/json_representations/request_elements.rb index cdbaa3a..c8c6d69 100644 --- a/spec/json_representations/request_elements.rb +++ b/spec/json_representations/request_elements.rb @@ -3,9 +3,10 @@ module RequestElements def request_element_representation(request_element) representation = { - :element => request_element.name, - :description => request_element.description, - :required => request_element.required + element: request_element.name, + description: request_element.description, + required: request_element.required, + optional: request_element.optional } representation.merge!({:type => request_element.type}) if request_element.type diff --git a/spec/json_representations/response_elements.rb b/spec/json_representations/response_elements.rb index 056657e..31826c0 100644 --- a/spec/json_representations/response_elements.rb +++ b/spec/json_representations/response_elements.rb @@ -3,15 +3,16 @@ module ResponseElements def response_element_representation(response_element) representation = { - :element => response_element.name, - :description => response_element.description, - :required => response_element.required + element: response_element.name, + description: response_element.description, + required: response_element.required, + optional: response_element.optional } - representation.merge!({:type => response_element.type}) if response_element.type + representation.merge!({ type: response_element.type }) if response_element.type if response_element.elements_type - representation.merge!({:elements_type => response_element.elements_type}) + representation.merge!({ elements_type: response_element.elements_type }) end representation diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4722b6b..cea2c73 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,17 +6,18 @@ require 'angus/sdoc' require 'rspec' +require 'rspec/its' require 'json_expressions/rspec' -require 'factory_girl' +require 'factory_bot' require 'simplecov-rcov' require 'simplecov-rcov-text' -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::RcovFormatter, SimpleCov::Formatter::RcovTextFormatter -] +]) Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each { |f| require f } @@ -29,7 +30,7 @@ config.order = 'random' config.before(:suite) do - FactoryGirl.find_definitions + FactoryBot.find_definitions end end