defra_ruby_mocks 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +8 -0
- data/README.md +149 -0
- data/Rakefile +38 -0
- data/app/controllers/defra_ruby_mocks/application_controller.rb +17 -0
- data/app/controllers/defra_ruby_mocks/company_controller.rb +23 -0
- data/app/services/defra_ruby_mocks/base_service.rb +9 -0
- data/app/services/defra_ruby_mocks/companies_house_service.rb +54 -0
- data/app/views/defra_ruby_mocks/company/not_found.json.erb +8 -0
- data/app/views/defra_ruby_mocks/company/show.json.erb +3 -0
- data/config/routes.rb +8 -0
- data/lib/defra_ruby_mocks.rb +26 -0
- data/lib/defra_ruby_mocks/configuration.rb +39 -0
- data/lib/defra_ruby_mocks/engine.rb +13 -0
- data/lib/defra_ruby_mocks/version.rb +5 -0
- data/lib/tasks/changelog.rake +8 -0
- data/lib/tasks/defra_ruby_mocks_tasks.rake +8 -0
- data/spec/defra_ruby_mocks_spec.rb +44 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +27 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +38 -0
- data/spec/dummy/config/environments/production.rb +76 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/to_time_preserves_timezone.rb +10 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +147 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/examples.txt +30 -0
- data/spec/lib/configuration_spec.rb +75 -0
- data/spec/rails_helper.rb +46 -0
- data/spec/requests/company_spec.rb +80 -0
- data/spec/services/companies_house_service_spec.rb +47 -0
- data/spec/spec_helper.rb +82 -0
- data/spec/support/helpers/configuration.rb +16 -0
- data/spec/support/pry.rb +7 -0
- data/spec/support/simplecov.rb +17 -0
- metadata +237 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DefraRubyMocks
|
4
|
+
RSpec.describe Configuration do
|
5
|
+
let(:subject) { described_class.new }
|
6
|
+
|
7
|
+
describe "#enable=" do
|
8
|
+
context "when passed true as boolean" do
|
9
|
+
it "sets enable to 'true'" do
|
10
|
+
subject.enable = true
|
11
|
+
|
12
|
+
expect(subject.enabled?).to be(true)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "when passed false as a boolean" do
|
17
|
+
it "sets enable to 'false'" do
|
18
|
+
subject.enable = false
|
19
|
+
|
20
|
+
expect(subject.enabled?).to be(false)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
context "when passed true as string" do
|
25
|
+
it "sets enable to 'true'" do
|
26
|
+
subject.enable = "true"
|
27
|
+
|
28
|
+
expect(subject.enabled?).to be(true)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "when passed false as a string" do
|
33
|
+
it "sets enable to 'false'" do
|
34
|
+
subject.enable = "false"
|
35
|
+
|
36
|
+
expect(subject.enabled?).to be(false)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe "#delay=" do
|
42
|
+
context "when passed 200 as an integer" do
|
43
|
+
it "sets delay to 200" do
|
44
|
+
subject.delay = 200
|
45
|
+
|
46
|
+
expect(subject.delay).to be(200)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "when passed 200 as a string" do
|
51
|
+
it "sets delay to 200" do
|
52
|
+
subject.delay = "200"
|
53
|
+
|
54
|
+
expect(subject.delay).to be(200)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "when passed a string that's not a number" do
|
59
|
+
it "sets delay to its default" do
|
60
|
+
subject.delay = ""
|
61
|
+
|
62
|
+
expect(subject.delay).to be(Configuration::DEFAULT_DELAY)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "when passed nil" do
|
67
|
+
it "sets delay to its default" do
|
68
|
+
subject.delay = nil
|
69
|
+
|
70
|
+
expect(subject.delay).to be(Configuration::DEFAULT_DELAY)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
4
|
+
require "spec_helper"
|
5
|
+
ENV["RAILS_ENV"] ||= "test"
|
6
|
+
require File.expand_path("dummy/config/environment", __dir__)
|
7
|
+
|
8
|
+
# Prevent database truncation if the environment is production
|
9
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
10
|
+
require "rspec/rails"
|
11
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
12
|
+
|
13
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
14
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
15
|
+
# run as spec files by default. This means that files in spec/support that end
|
16
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
17
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
18
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
19
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
20
|
+
#
|
21
|
+
# We make an exception for simplecov because that will already have been
|
22
|
+
# required and run at the very top of spec_helper.rb
|
23
|
+
support_files = Dir["./spec/support/**/*.rb"].reject { |file| file == "./spec/support/simplecov.rb" }
|
24
|
+
support_files.each { |f| require f }
|
25
|
+
|
26
|
+
RSpec.configure do |config|
|
27
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
28
|
+
# based on their file location, for example enabling you to call `get` and
|
29
|
+
# `post` in specs under `spec/controllers`.
|
30
|
+
#
|
31
|
+
# You can disable this behaviour by removing the line below, and instead
|
32
|
+
# explicitly tag your specs with their type, e.g.:
|
33
|
+
#
|
34
|
+
# RSpec.describe UsersController, :type => :controller do
|
35
|
+
# # ...
|
36
|
+
# end
|
37
|
+
#
|
38
|
+
# The different available types are documented in the features, such as in
|
39
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
40
|
+
config.infer_spec_type_from_file_location!
|
41
|
+
|
42
|
+
# Filter lines from Rails gems in backtraces.
|
43
|
+
config.filter_rails_from_backtrace!
|
44
|
+
# arbitrary gems may also be filtered via:
|
45
|
+
# config.filter_gems_from_backtrace("gem name")
|
46
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails_helper"
|
4
|
+
|
5
|
+
module DefraRuby
|
6
|
+
RSpec.describe "Company", type: :request do
|
7
|
+
|
8
|
+
let(:path) { "/defra_ruby_mocks/company" }
|
9
|
+
|
10
|
+
context "when mocks are enabled" do
|
11
|
+
before(:all) { Helpers::Configuration.prep_for_tests }
|
12
|
+
after(:all) { Helpers::Configuration.reset_for_tests }
|
13
|
+
|
14
|
+
context "when the company number is 99999999 for not found" do
|
15
|
+
let(:company_number) { "99999999" }
|
16
|
+
|
17
|
+
it "returns a JSON response with a code of 404" do
|
18
|
+
get "#{path}/#{company_number}"
|
19
|
+
content = JSON.parse(response.body)
|
20
|
+
|
21
|
+
expect(response.content_type).to eq("application/json")
|
22
|
+
expect(response.code).to eq("404")
|
23
|
+
expect(content).to include("errors")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "when the company number is from the 'specials' list" do
|
28
|
+
let(:company_number) { "05868270" }
|
29
|
+
|
30
|
+
it "returns a JSON response with a 200 code and a status that isn't 'active'" do
|
31
|
+
get "#{path}/#{company_number}"
|
32
|
+
company_status = JSON.parse(response.body)["company_status"]
|
33
|
+
|
34
|
+
expect(response.content_type).to eq("application/json")
|
35
|
+
expect(response.code).to eq("200")
|
36
|
+
expect(company_status).not_to eq("active")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
context "when the company number is not from the 'specials' list" do
|
41
|
+
context "and it is valid" do
|
42
|
+
let(:company_number) { "SC247974" }
|
43
|
+
|
44
|
+
it "returns a JSON response with a 200 code and a status of 'active'" do
|
45
|
+
get "#{path}/#{company_number}"
|
46
|
+
company_status = JSON.parse(response.body)["company_status"]
|
47
|
+
|
48
|
+
expect(response.content_type).to eq("application/json")
|
49
|
+
expect(response.code).to eq("200")
|
50
|
+
expect(company_status).to eq("active")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context "and it is not valid" do
|
55
|
+
let(:company_number) { "foo" }
|
56
|
+
|
57
|
+
it "returns a JSON response with a 404 code" do
|
58
|
+
get "#{path}/#{company_number}"
|
59
|
+
content = JSON.parse(response.body)
|
60
|
+
|
61
|
+
expect(response.content_type).to eq("application/json")
|
62
|
+
expect(response.code).to eq("404")
|
63
|
+
expect(content).to include("errors")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "when mocks are disabled" do
|
70
|
+
before(:all) { DefraRubyMocks.configuration.enable = false }
|
71
|
+
|
72
|
+
let(:company_number) { "SC247974" }
|
73
|
+
|
74
|
+
it "cannot load the page" do
|
75
|
+
expect { get "#{path}/#{company_number}" }.to raise_error(ActionController::RoutingError)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails_helper"
|
4
|
+
|
5
|
+
module DefraRubyMocks
|
6
|
+
RSpec.describe CompaniesHouseService do
|
7
|
+
describe ".run" do
|
8
|
+
context "when the company number is 99999999 for not found" do
|
9
|
+
let(:company_number) { "99999999" }
|
10
|
+
|
11
|
+
it "raises a NotFoundError" do
|
12
|
+
expect { described_class.run(company_number) }.to raise_error(NotFoundError)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "when the company number is from the 'specials' list" do
|
17
|
+
specials = CompaniesHouseService.special_company_numbers
|
18
|
+
|
19
|
+
specials.each do |company_number, status|
|
20
|
+
context "and the number is #{company_number}" do
|
21
|
+
it "returns a status of '#{status}'" do
|
22
|
+
expect(described_class.run(company_number)).to eq(status)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "when the company number is not from the 'specials' list" do
|
29
|
+
context "and it is valid" do
|
30
|
+
let(:company_number) { "SC247974" }
|
31
|
+
|
32
|
+
it "returns a status of 'active'" do
|
33
|
+
expect(described_class.run(company_number)).to eq("active")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context "and it is not valid" do
|
38
|
+
let(:company_number) { "foo" }
|
39
|
+
|
40
|
+
it "raises a NotFoundError" do
|
41
|
+
expect { described_class.run(company_number) }.to raise_error(NotFoundError)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "simplecov"
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
7
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
8
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
9
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
10
|
+
# files.
|
11
|
+
#
|
12
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
13
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
14
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
15
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
16
|
+
# a separate helper file that requires the additional dependencies and performs
|
17
|
+
# the additional setup, and require it from the spec files that actually need
|
18
|
+
# it.
|
19
|
+
#
|
20
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
21
|
+
RSpec.configure do |config|
|
22
|
+
# rspec-expectations config goes here. You can use an alternate
|
23
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
24
|
+
# assertions if you prefer.
|
25
|
+
config.expect_with :rspec do |expectations|
|
26
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
27
|
+
# and `failure_message` of custom matchers include text for helper methods
|
28
|
+
# defined using `chain`, e.g.:
|
29
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
30
|
+
# # => "be bigger than 2 and smaller than 4"
|
31
|
+
# ...rather than:
|
32
|
+
# # => "be bigger than 2"
|
33
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
34
|
+
end
|
35
|
+
|
36
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
37
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
38
|
+
config.mock_with :rspec do |mocks|
|
39
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
40
|
+
# a real object. This is generally recommended, and will default to
|
41
|
+
# `true` in RSpec 4.
|
42
|
+
mocks.verify_partial_doubles = true
|
43
|
+
end
|
44
|
+
|
45
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
46
|
+
# have no way to turn it off -- the option exists only for backwards
|
47
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
48
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
49
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
50
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
51
|
+
|
52
|
+
# This allows you to limit a spec run to individual examples or groups
|
53
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
54
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
55
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
56
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
57
|
+
config.filter_run_when_matching :focus
|
58
|
+
|
59
|
+
# Allows RSpec to persist some state between runs in order to support
|
60
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
61
|
+
# you configure your source control system to ignore this file.
|
62
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
63
|
+
|
64
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
65
|
+
# recommended. For more details, see:
|
66
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
67
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
68
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
69
|
+
config.disable_monkey_patching!
|
70
|
+
|
71
|
+
# Run specs in random order to surface order dependencies. If you find an
|
72
|
+
# order dependency and want to debug it, you can fix the order by providing
|
73
|
+
# the seed, which is printed after each run.
|
74
|
+
# --seed 1234
|
75
|
+
config.order = :random
|
76
|
+
|
77
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
78
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
79
|
+
# test failures related to randomization by passing the same `--seed` value
|
80
|
+
# as the one that triggered the failure.
|
81
|
+
Kernel.srand config.seed
|
82
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Helpers
|
4
|
+
module Configuration
|
5
|
+
def self.prep_for_tests(delay = 100)
|
6
|
+
DefraRubyMocks.configure do |config|
|
7
|
+
config.enable = true
|
8
|
+
config.delay = delay
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.reset_for_tests
|
13
|
+
DefraRubyMocks.reset_configuration
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/spec/support/pry.rb
ADDED
@@ -0,0 +1,7 @@
|
|
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"
|
@@ -0,0 +1,17 @@
|
|
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
|
metadata
ADDED
@@ -0,0 +1,237 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: defra_ruby_mocks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Defra
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.11.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.11.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: github_changelog_generator
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: defra_ruby_style
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-rails
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.8.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.8.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: A Rails engine which can be used to mock external services when loaded
|
98
|
+
into an application
|
99
|
+
email:
|
100
|
+
- alan.cruikshanks@environment-agency.gov.uk
|
101
|
+
executables: []
|
102
|
+
extensions: []
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- LICENSE
|
106
|
+
- README.md
|
107
|
+
- Rakefile
|
108
|
+
- app/controllers/defra_ruby_mocks/application_controller.rb
|
109
|
+
- app/controllers/defra_ruby_mocks/company_controller.rb
|
110
|
+
- app/services/defra_ruby_mocks/base_service.rb
|
111
|
+
- app/services/defra_ruby_mocks/companies_house_service.rb
|
112
|
+
- app/views/defra_ruby_mocks/company/not_found.json.erb
|
113
|
+
- app/views/defra_ruby_mocks/company/show.json.erb
|
114
|
+
- config/routes.rb
|
115
|
+
- lib/defra_ruby_mocks.rb
|
116
|
+
- lib/defra_ruby_mocks/configuration.rb
|
117
|
+
- lib/defra_ruby_mocks/engine.rb
|
118
|
+
- lib/defra_ruby_mocks/version.rb
|
119
|
+
- lib/tasks/changelog.rake
|
120
|
+
- lib/tasks/defra_ruby_mocks_tasks.rake
|
121
|
+
- spec/defra_ruby_mocks_spec.rb
|
122
|
+
- spec/dummy/README.rdoc
|
123
|
+
- spec/dummy/Rakefile
|
124
|
+
- spec/dummy/app/assets/javascripts/application.js
|
125
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
126
|
+
- spec/dummy/app/controllers/application_controller.rb
|
127
|
+
- spec/dummy/app/helpers/application_helper.rb
|
128
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
129
|
+
- spec/dummy/bin/bundle
|
130
|
+
- spec/dummy/bin/rails
|
131
|
+
- spec/dummy/bin/rake
|
132
|
+
- spec/dummy/bin/setup
|
133
|
+
- spec/dummy/config.ru
|
134
|
+
- spec/dummy/config/application.rb
|
135
|
+
- spec/dummy/config/boot.rb
|
136
|
+
- spec/dummy/config/environment.rb
|
137
|
+
- spec/dummy/config/environments/development.rb
|
138
|
+
- spec/dummy/config/environments/production.rb
|
139
|
+
- spec/dummy/config/environments/test.rb
|
140
|
+
- spec/dummy/config/initializers/assets.rb
|
141
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
142
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
143
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
144
|
+
- spec/dummy/config/initializers/inflections.rb
|
145
|
+
- spec/dummy/config/initializers/mime_types.rb
|
146
|
+
- spec/dummy/config/initializers/session_store.rb
|
147
|
+
- spec/dummy/config/initializers/to_time_preserves_timezone.rb
|
148
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
149
|
+
- spec/dummy/config/locales/en.yml
|
150
|
+
- spec/dummy/config/routes.rb
|
151
|
+
- spec/dummy/config/secrets.yml
|
152
|
+
- spec/dummy/log/development.log
|
153
|
+
- spec/dummy/log/test.log
|
154
|
+
- spec/dummy/public/404.html
|
155
|
+
- spec/dummy/public/422.html
|
156
|
+
- spec/dummy/public/500.html
|
157
|
+
- spec/dummy/public/favicon.ico
|
158
|
+
- spec/examples.txt
|
159
|
+
- spec/lib/configuration_spec.rb
|
160
|
+
- spec/rails_helper.rb
|
161
|
+
- spec/requests/company_spec.rb
|
162
|
+
- spec/services/companies_house_service_spec.rb
|
163
|
+
- spec/spec_helper.rb
|
164
|
+
- spec/support/helpers/configuration.rb
|
165
|
+
- spec/support/pry.rb
|
166
|
+
- spec/support/simplecov.rb
|
167
|
+
homepage: https://github.com/DEFRA/defra-ruby-mocks
|
168
|
+
licenses:
|
169
|
+
- The Open Government Licence (OGL) Version 3
|
170
|
+
metadata: {}
|
171
|
+
post_install_message:
|
172
|
+
rdoc_options: []
|
173
|
+
require_paths:
|
174
|
+
- lib
|
175
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
requirements: []
|
186
|
+
rubyforge_project:
|
187
|
+
rubygems_version: 2.6.13
|
188
|
+
signing_key:
|
189
|
+
specification_version: 4
|
190
|
+
summary: Defra Ruby on Rails external API mocking engine
|
191
|
+
test_files:
|
192
|
+
- spec/spec_helper.rb
|
193
|
+
- spec/dummy/app/controllers/application_controller.rb
|
194
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
195
|
+
- spec/dummy/app/assets/javascripts/application.js
|
196
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
197
|
+
- spec/dummy/app/helpers/application_helper.rb
|
198
|
+
- spec/dummy/bin/rake
|
199
|
+
- spec/dummy/bin/setup
|
200
|
+
- spec/dummy/bin/bundle
|
201
|
+
- spec/dummy/bin/rails
|
202
|
+
- spec/dummy/config/secrets.yml
|
203
|
+
- spec/dummy/config/routes.rb
|
204
|
+
- spec/dummy/config/locales/en.yml
|
205
|
+
- spec/dummy/config/environments/production.rb
|
206
|
+
- spec/dummy/config/environments/development.rb
|
207
|
+
- spec/dummy/config/environments/test.rb
|
208
|
+
- spec/dummy/config/environment.rb
|
209
|
+
- spec/dummy/config/application.rb
|
210
|
+
- spec/dummy/config/boot.rb
|
211
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
212
|
+
- spec/dummy/config/initializers/mime_types.rb
|
213
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
214
|
+
- spec/dummy/config/initializers/session_store.rb
|
215
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
216
|
+
- spec/dummy/config/initializers/assets.rb
|
217
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
218
|
+
- spec/dummy/config/initializers/to_time_preserves_timezone.rb
|
219
|
+
- spec/dummy/config/initializers/inflections.rb
|
220
|
+
- spec/dummy/config.ru
|
221
|
+
- spec/dummy/Rakefile
|
222
|
+
- spec/dummy/public/favicon.ico
|
223
|
+
- spec/dummy/public/422.html
|
224
|
+
- spec/dummy/public/500.html
|
225
|
+
- spec/dummy/public/404.html
|
226
|
+
- spec/dummy/log/test.log
|
227
|
+
- spec/dummy/log/development.log
|
228
|
+
- spec/dummy/README.rdoc
|
229
|
+
- spec/examples.txt
|
230
|
+
- spec/defra_ruby_mocks_spec.rb
|
231
|
+
- spec/requests/company_spec.rb
|
232
|
+
- spec/support/simplecov.rb
|
233
|
+
- spec/support/pry.rb
|
234
|
+
- spec/support/helpers/configuration.rb
|
235
|
+
- spec/lib/configuration_spec.rb
|
236
|
+
- spec/rails_helper.rb
|
237
|
+
- spec/services/companies_house_service_spec.rb
|