defra_ruby_mocks 2.4.2 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/defra_ruby_mocks/companies_house_service.rb +1 -3
- data/app/services/defra_ruby_mocks/govpay_create_payment_service.rb +18 -18
- data/app/services/defra_ruby_mocks/govpay_get_payment_service.rb +50 -50
- data/app/services/defra_ruby_mocks/govpay_refund_details_service.rb +6 -6
- data/app/services/defra_ruby_mocks/govpay_request_refund_service.rb +4 -4
- data/lib/defra_ruby_mocks/version.rb +1 -1
- metadata +12 -207
- data/spec/defra_ruby_mocks_spec.rb +0 -44
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -29
- data/spec/dummy/config/application.rb +0 -27
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -38
- data/spec/dummy/config/environments/production.rb +0 -76
- data/spec/dummy/config/environments/test.rb +0 -42
- data/spec/dummy/config/initializers/assets.rb +0 -11
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/initializers/to_time_preserves_timezone.rb +0 -10
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -9
- data/spec/dummy/config/locales/en.yml +0 -23
- data/spec/dummy/config/routes.rb +0 -4
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/log/test.log +0 -2013
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/examples.txt +0 -68
- data/spec/fixtures/files/govpay/create_payment_created_response.json +0 -24
- data/spec/fixtures/files/govpay/create_payment_error_response.json +0 -5
- data/spec/fixtures/files/govpay/get_payment_response_cancelled.json +0 -61
- data/spec/fixtures/files/govpay/get_payment_response_created.json +0 -73
- data/spec/fixtures/files/govpay/get_payment_response_error.json +0 -5
- data/spec/fixtures/files/govpay/get_payment_response_failure.json +0 -9
- data/spec/fixtures/files/govpay/get_payment_response_not_found.json +0 -4
- data/spec/fixtures/files/govpay/get_payment_response_submitted.json +0 -75
- data/spec/fixtures/files/govpay/get_payment_response_success.json +0 -62
- data/spec/lib/configuration_spec.rb +0 -75
- data/spec/rails_helper.rb +0 -46
- data/spec/requests/company_spec.rb +0 -91
- data/spec/requests/govpay_spec.rb +0 -170
- data/spec/requests/officers_spec.rb +0 -37
- data/spec/services/companies_house_service_spec.rb +0 -69
- data/spec/services/govpay_create_payment_service_spec.rb +0 -44
- data/spec/services/govpay_get_payment_service_spec.rb +0 -30
- data/spec/services/govpay_refund_details_service_spec.rb +0 -58
- data/spec/services/govpay_request_refund_service_spec.rb +0 -31
- data/spec/spec_helper.rb +0 -86
- data/spec/support/helpers/configuration.rb +0 -17
- data/spec/support/helpers/helpers.rb +0 -13
- data/spec/support/helpers/waste_carriers_engine.rb +0 -10
- data/spec/support/helpers/xml_matchers.rb +0 -19
- data/spec/support/pry.rb +0 -7
- data/spec/support/simplecov.rb +0 -17
data/spec/spec_helper.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Require and run our simplecov initializer as the very first thing we do.
|
4
|
-
# This is as per its docs https://github.com/colszowka/simplecov#getting-started
|
5
|
-
require "./spec/support/simplecov"
|
6
|
-
|
7
|
-
require "rails-controller-testing"
|
8
|
-
Rails::Controller::Testing.install
|
9
|
-
|
10
|
-
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
11
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
12
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
13
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
14
|
-
# files.
|
15
|
-
#
|
16
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
17
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
18
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
19
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
20
|
-
# a separate helper file that requires the additional dependencies and performs
|
21
|
-
# the additional setup, and require it from the spec files that actually need
|
22
|
-
# it.
|
23
|
-
#
|
24
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
25
|
-
RSpec.configure do |config|
|
26
|
-
# rspec-expectations config goes here. You can use an alternate
|
27
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
28
|
-
# assertions if you prefer.
|
29
|
-
config.expect_with :rspec do |expectations|
|
30
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
31
|
-
# and `failure_message` of custom matchers include text for helper methods
|
32
|
-
# defined using `chain`, e.g.:
|
33
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
34
|
-
# # => "be bigger than 2 and smaller than 4"
|
35
|
-
# ...rather than:
|
36
|
-
# # => "be bigger than 2"
|
37
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
38
|
-
end
|
39
|
-
|
40
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
41
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
42
|
-
config.mock_with :rspec do |mocks|
|
43
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
44
|
-
# a real object. This is generally recommended, and will default to
|
45
|
-
# `true` in RSpec 4.
|
46
|
-
mocks.verify_partial_doubles = true
|
47
|
-
end
|
48
|
-
|
49
|
-
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
50
|
-
# have no way to turn it off -- the option exists only for backwards
|
51
|
-
# compatibility in RSpec 3). It causes shared context metadata to be
|
52
|
-
# inherited by the metadata hash of host groups and examples, rather than
|
53
|
-
# triggering implicit auto-inclusion in groups with matching metadata.
|
54
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
55
|
-
|
56
|
-
# This allows you to limit a spec run to individual examples or groups
|
57
|
-
# you care about by tagging them with `:focus` metadata. When nothing
|
58
|
-
# is tagged with `:focus`, all examples get run. RSpec also provides
|
59
|
-
# aliases for `it`, `describe`, and `context` that include `:focus`
|
60
|
-
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
61
|
-
config.filter_run_when_matching :focus
|
62
|
-
|
63
|
-
# Allows RSpec to persist some state between runs in order to support
|
64
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
65
|
-
# you configure your source control system to ignore this file.
|
66
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
67
|
-
|
68
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
69
|
-
# recommended. For more details, see:
|
70
|
-
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
71
|
-
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
72
|
-
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
73
|
-
config.disable_monkey_patching!
|
74
|
-
|
75
|
-
# Run specs in random order to surface order dependencies. If you find an
|
76
|
-
# order dependency and want to debug it, you can fix the order by providing
|
77
|
-
# the seed, which is printed after each run.
|
78
|
-
# --seed 1234
|
79
|
-
config.order = :random
|
80
|
-
|
81
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
82
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
83
|
-
# test failures related to randomization by passing the same `--seed` value
|
84
|
-
# as the one that triggered the failure.
|
85
|
-
Kernel.srand config.seed
|
86
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Helpers
|
4
|
-
module Configuration
|
5
|
-
def self.prep_for_tests(delay = 100)
|
6
|
-
DefraRubyMocks.reset_configuration
|
7
|
-
DefraRubyMocks.configure do |config|
|
8
|
-
config.enable = true
|
9
|
-
config.delay = delay
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.reset_for_tests
|
14
|
-
DefraRubyMocks.reset_configuration
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rspec/expectations"
|
4
|
-
|
5
|
-
RSpec::Matchers.define :be_xml do
|
6
|
-
match do
|
7
|
-
begin
|
8
|
-
Nokogiri::XML(actual, &:strict)
|
9
|
-
|
10
|
-
true
|
11
|
-
rescue Nokogiri::XML::SyntaxError
|
12
|
-
false
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
failure_message do |actual|
|
17
|
-
"expected that \"#{actual}\" would be a valid XML document"
|
18
|
-
end
|
19
|
-
end
|
data/spec/support/pry.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Support debugging in the tests. Add `binding.pry` wherever you want execution
|
4
|
-
# to stop and the debugger to kick in.
|
5
|
-
# Details on the debugging commands can be found here
|
6
|
-
# https://github.com/deivid-rodriguez/pry-byebug#commands
|
7
|
-
require "pry-byebug"
|
data/spec/support/simplecov.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "simplecov"
|
4
|
-
|
5
|
-
# We start it with the rails param to ensure it includes coverage for all code
|
6
|
-
# started by the rails app, and not just the files touched by our unit tests.
|
7
|
-
# This gives us the most accurate assessment of our unit test coverage
|
8
|
-
# https://github.com/colszowka/simplecov#getting-started
|
9
|
-
SimpleCov.start do
|
10
|
-
# We filter the spec folder, mainly to ensure that any dummy apps don't get
|
11
|
-
# included in the coverage report. However our intent is that nothing in the
|
12
|
-
# spec folder should be included
|
13
|
-
add_filter "/spec/"
|
14
|
-
# The version file is simply just that, so we do not feel the need to ensure
|
15
|
-
# we have a test for it
|
16
|
-
add_filter "lib/defra_ruby/mocks/version"
|
17
|
-
end
|