defra_ruby_area 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +4 -4
  3. data/Rakefile +2 -2
  4. data/bin/console +3 -7
  5. data/lib/defra_ruby/area/area.rb +1 -1
  6. data/lib/defra_ruby/area/response.rb +1 -2
  7. data/lib/defra_ruby/area/version.rb +1 -1
  8. data/spec/defra_ruby/area/area_spec.rb +1 -1
  9. data/spec/defra_ruby/area/response_spec.rb +1 -1
  10. data/spec/defra_ruby/area/services/public_face_area_service_spec.rb +27 -9
  11. data/spec/defra_ruby/area/services/water_management_area_service_spec.rb +27 -9
  12. data/spec/fixtures/public_face_area_invalid_blank.xml +5 -0
  13. data/spec/fixtures/public_face_area_invalid_coords.xml +8 -0
  14. data/spec/fixtures/public_face_area_valid.xml +18 -0
  15. data/spec/fixtures/public_face_area_valid_multiple.xml +28 -0
  16. data/spec/fixtures/water_management_area_invalid_blank.xml +5 -0
  17. data/spec/fixtures/water_management_area_invalid_coords.xml +8 -0
  18. data/spec/fixtures/{valid.xml → water_management_area_valid.xml} +0 -0
  19. data/spec/fixtures/water_management_area_valid_multiple.xml +32 -0
  20. data/spec/support/shared_examples/handle_request_errors.rb +0 -4
  21. metadata +23 -44
  22. data/spec/cassettes/public_face_area_invalid_blank.yml +0 -49
  23. data/spec/cassettes/public_face_area_invalid_coords.yml +0 -52
  24. data/spec/cassettes/public_face_area_valid.yml +0 -62
  25. data/spec/cassettes/public_face_area_valid_multiple.yml +0 -72
  26. data/spec/cassettes/water_management_area_invalid_blank.yml +0 -49
  27. data/spec/cassettes/water_management_area_invalid_coords.yml +0 -52
  28. data/spec/cassettes/water_management_area_valid.yml +0 -64
  29. data/spec/cassettes/water_management_area_valid_multiple.yml +0 -76
  30. data/spec/examples.txt +0 -27
  31. data/spec/support/vcr.rb +0 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2bcadf14ad034b135923304cc09831767bad6e06
4
- data.tar.gz: 98a662e1d55ea09410e266ba61fc00a45bf9dd14
2
+ SHA256:
3
+ metadata.gz: a43ea753e6492ca0eae96fceabde1cb91acdac425e0acef8384bf5f6137e6f6f
4
+ data.tar.gz: 655eb3b2602c76d2ef8a6d722fb120259531e66e19014f1086065ef939384679
5
5
  SHA512:
6
- metadata.gz: faae971a1911a07d0b53d60ac6b83b5e5c6fd34a5283b787f9c4bc4537ff659a0668d117b7ba5cbf0975c7241666d6a4d848982d667c6893a8ebbfcb9c16d59b
7
- data.tar.gz: 9198b827e537d4212e10ff9aafe61327fdaaaa867187140241e8a45da693521ea5e09ebeec4a10320a855173d16f7fa492ca217ff8125101450550fbf2136e55
6
+ metadata.gz: 49999e597ec06809299bddf8070b05791410f4527c300c63f2308a084039cd27ebf6957afa98b6f16492154ab1c50f3365754014ff6456d370440ff62441eaf0
7
+ data.tar.gz: d2c69e0e057f8709670f2114c882f6af81d14550eba959330525d53d4ee58fb2bfc726feb2cccfec2d01ccb66171038800755d0fa5f99eee1b2c86a5d136ee8a
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Defra Ruby Area
2
2
 
3
- [![Build Status](https://travis-ci.com/DEFRA/defra-ruby-area.svg?branch=master)](https://travis-ci.com/DEFRA/defra-ruby-area)
4
- [![Maintainability](https://api.codeclimate.com/v1/badges/7aeffed0588d86a5e553/maintainability)](https://codeclimate.com/github/DEFRA/defra-ruby-area/maintainability)
5
- [![Test Coverage](https://api.codeclimate.com/v1/badges/7aeffed0588d86a5e553/test_coverage)](https://codeclimate.com/github/DEFRA/defra-ruby-area/test_coverage)
6
- [![security](https://hakiri.io/github/DEFRA/defra-ruby-area/master.svg)](https://hakiri.io/github/DEFRA/defra-ruby-area/master)
3
+ ![Build Status](https://github.com/DEFRA/defra-ruby-area/workflows/CI/badge.svg?branch=main)
4
+ [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_defra-ruby-area&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=DEFRA_defra-ruby-area)
5
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=DEFRA_defra-ruby-area&metric=coverage)](https://sonarcloud.io/dashboard?id=DEFRA_defra-ruby-area)
6
+ [![security](https://hakiri.io/github/DEFRA/defra-ruby-area/main.svg)](https://hakiri.io/github/DEFRA/defra-ruby-area/main)
7
7
  [![Gem Version](https://badge.fury.io/rb/defra_ruby_area.svg)](https://badge.fury.io/rb/defra_ruby_area)
8
8
  [![Licence](https://img.shields.io/badge/Licence-OGLv3-blue.svg)](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3)
9
9
 
data/Rakefile CHANGED
@@ -11,7 +11,6 @@ Bundler::GemHelper.install_tasks
11
11
  # This is wrapped to prevent an error when rake is called in environments where
12
12
  # rspec may not be available, e.g. production. As such we don't need to handle
13
13
  # the error.
14
- # rubocop:disable Lint/HandleExceptions
15
14
  begin
16
15
  require "rspec/core/rake_task"
17
16
 
@@ -26,8 +25,9 @@ begin
26
25
  require "github_changelog_generator/task"
27
26
 
28
27
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
28
+ config.user = "defra"
29
+ config.project = "defra-ruby-area"
29
30
  end
30
31
  rescue LoadError
31
32
  # no changelog available
32
33
  end
33
- # rubocop:enable Lint/HandleExceptions
data/bin/console CHANGED
@@ -1,14 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "defra/ruby/area"
4
+ require "defra_ruby/area"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
8
8
 
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
9
+ require "pry"
10
+ Pry.start
@@ -17,7 +17,7 @@ module DefraRuby
17
17
  private
18
18
 
19
19
  def validate_xml
20
- raise(ArgumentError, "wfs_xml_element is invalid") unless @xml&.is_a?(Nokogiri::XML::Element)
20
+ raise(ArgumentError, "wfs_xml_element is invalid") unless @xml.is_a?(Nokogiri::XML::Element)
21
21
  end
22
22
 
23
23
  def parse_xml
@@ -3,8 +3,7 @@
3
3
  module DefraRuby
4
4
  module Area
5
5
  class Response
6
- attr_reader :error
7
- attr_reader :areas
6
+ attr_reader :error, :areas
8
7
 
9
8
  def initialize(response_exe)
10
9
  @success = true
@@ -2,6 +2,6 @@
2
2
 
3
3
  module DefraRuby
4
4
  module Area
5
- VERSION = "2.0.0"
5
+ VERSION = "2.0.1"
6
6
  end
7
7
  end
@@ -7,7 +7,7 @@ module DefraRuby
7
7
  module Area
8
8
  RSpec.describe Area do
9
9
  let(:valid_xml) do
10
- document = Nokogiri::XML(File.read("spec/fixtures/valid.xml"))
10
+ document = Nokogiri::XML(File.read("spec/fixtures/water_management_area_valid.xml"))
11
11
  document.xpath("//wfs:FeatureCollection/gml:featureMember").first.first_element_child
12
12
  end
13
13
  let(:invalid_xml) { "foo" }
@@ -8,7 +8,7 @@ module DefraRuby
8
8
  subject(:response) { described_class.new(response_exe) }
9
9
 
10
10
  let(:valid_xml) do
11
- document = Nokogiri::XML(File.read("spec/fixtures/valid.xml"))
11
+ document = Nokogiri::XML(File.read("spec/fixtures/water_management_area_valid.xml"))
12
12
  document.xpath("//wfs:FeatureCollection/gml:featureMember").first.first_element_child
13
13
  end
14
14
 
@@ -1,15 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "webmock/rspec"
3
4
  require "spec_helper"
4
5
 
5
6
  module DefraRuby
6
7
  module Area
7
8
  RSpec.describe PublicFaceAreaService do
8
- describe "#run" do
9
+ let(:host) { "https://environment.data.gov.uk" }
9
10
 
11
+ describe "#run" do
10
12
  context "when the coordinates are valid and in England" do
11
- before(:each) { VCR.insert_cassette("public_face_area_valid") }
12
- after(:each) { VCR.eject_cassette }
13
+ before do
14
+ stub_request(:any, /.*#{host}.*/).to_return(
15
+ status: 200,
16
+ body: File.read("./spec/fixtures/public_face_area_valid.xml")
17
+ )
18
+ end
13
19
 
14
20
  let(:easting) { 408_602.61 }
15
21
  let(:northing) { 257_535.31 }
@@ -24,8 +30,12 @@ module DefraRuby
24
30
  end
25
31
 
26
32
  context "when the coordinates are valid, in England but match more than one area" do
27
- before(:each) { VCR.insert_cassette("public_face_area_valid_multiple") }
28
- after(:each) { VCR.eject_cassette }
33
+ before do
34
+ stub_request(:any, /.*#{host}.*/).to_return(
35
+ status: 200,
36
+ body: File.read("./spec/fixtures/public_face_area_valid_multiple.xml")
37
+ )
38
+ end
29
39
 
30
40
  let(:easting) { 398_056.684 }
31
41
  let(:northing) { 414_748 }
@@ -40,8 +50,12 @@ module DefraRuby
40
50
 
41
51
  context "when the coordinates are invalid" do
42
52
  context "because they are blank" do
43
- before(:each) { VCR.insert_cassette("public_face_area_invalid_blank") }
44
- after(:each) { VCR.eject_cassette }
53
+ before do
54
+ stub_request(:any, /.*#{host}.*/).to_return(
55
+ status: 200,
56
+ body: File.read("./spec/fixtures/public_face_area_invalid_blank.xml")
57
+ )
58
+ end
45
59
 
46
60
  let(:easting) { nil }
47
61
  let(:northing) { nil }
@@ -56,8 +70,12 @@ module DefraRuby
56
70
  end
57
71
 
58
72
  context "because they are not in an area" do
59
- before(:each) { VCR.insert_cassette("public_face_area_invalid_coords") }
60
- after(:each) { VCR.eject_cassette }
73
+ before do
74
+ stub_request(:any, /.*#{host}.*/).to_return(
75
+ status: 200,
76
+ body: File.read("./spec/fixtures/public_face_area_invalid_coords.xml")
77
+ )
78
+ end
61
79
 
62
80
  let(:easting) { 301_233.0 }
63
81
  let(:northing) { 221_592.0 }
@@ -1,15 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "webmock/rspec"
3
4
  require "spec_helper"
4
5
 
5
6
  module DefraRuby
6
7
  module Area
7
8
  RSpec.describe WaterManagementAreaService do
8
- describe "#run" do
9
+ let(:host) { "https://environment.data.gov.uk" }
9
10
 
11
+ describe "#run" do
10
12
  context "when the coordinates are valid and in England" do
11
- before(:each) { VCR.insert_cassette("water_management_area_valid") }
12
- after(:each) { VCR.eject_cassette }
13
+ before do
14
+ stub_request(:any, /.*#{host}.*/).to_return(
15
+ status: 200,
16
+ body: File.read("./spec/fixtures/water_management_area_valid.xml")
17
+ )
18
+ end
13
19
 
14
20
  let(:easting) { 408_602.61 }
15
21
  let(:northing) { 257_535.31 }
@@ -24,8 +30,12 @@ module DefraRuby
24
30
  end
25
31
 
26
32
  context "when the coordinates are valid, in England but match more than one area" do
27
- before(:each) { VCR.insert_cassette("water_management_area_valid_multiple") }
28
- after(:each) { VCR.eject_cassette }
33
+ before do
34
+ stub_request(:any, /.*#{host}.*/).to_return(
35
+ status: 200,
36
+ body: File.read("./spec/fixtures/water_management_area_valid_multiple.xml")
37
+ )
38
+ end
29
39
 
30
40
  let(:easting) { 456_330 }
31
41
  let(:northing) { 267_000 }
@@ -40,8 +50,12 @@ module DefraRuby
40
50
 
41
51
  context "when the coordinates are invalid" do
42
52
  context "because they are blank" do
43
- before(:each) { VCR.insert_cassette("water_management_area_invalid_blank") }
44
- after(:each) { VCR.eject_cassette }
53
+ before do
54
+ stub_request(:any, /.*#{host}.*/).to_return(
55
+ status: 200,
56
+ body: File.read("./spec/fixtures/water_management_area_invalid_blank.xml")
57
+ )
58
+ end
45
59
 
46
60
  let(:easting) { nil }
47
61
  let(:northing) { nil }
@@ -56,8 +70,12 @@ module DefraRuby
56
70
  end
57
71
 
58
72
  context "because they are not in an area" do
59
- before(:each) { VCR.insert_cassette("water_management_area_invalid_coords") }
60
- after(:each) { VCR.eject_cassette }
73
+ before do
74
+ stub_request(:any, /.*#{host}.*/).to_return(
75
+ status: 200,
76
+ body: File.read("./spec/fixtures/water_management_area_invalid_coords.xml")
77
+ )
78
+ end
61
79
 
62
80
  let(:easting) { 301_233.0 }
63
81
  let(:northing) { 221_592.0 }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <ogc:ServiceExceptionReport xmlns:ogc="http://www.opengis.net/ogc" version="1.2.0">
3
+ <ogc:ServiceException><![CDATA[The geometry was not recognized.]]></ogc:ServiceException>
4
+ <ogc:ServiceException><![CDATA[Operator 'Intersects' can't parse geometry.]]></ogc:ServiceException>
5
+ </ogc:ServiceExceptionReport>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
3
+ <gml:boundedBy>
4
+ <gml:Box srsName="EPSG:27700">
5
+ <gml:coordinates>0,0,0,0</gml:coordinates>
6
+ </gml:Box>
7
+ </gml:boundedBy>
8
+ </wfs:FeatureCollection>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
3
+ <gml:boundedBy>
4
+ <gml:Box srsName="EPSG:27700">
5
+ <gml:coordinates>0,0,0,0</gml:coordinates>
6
+ </gml:Box>
7
+ </gml:boundedBy>
8
+ <gml:featureMember>
9
+ <ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas fid="Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas.23">
10
+ <ms:OBJECTID>23</ms:OBJECTID>
11
+ <ms:long_name>West Midlands</ms:long_name>
12
+ <ms:short_name>West Midlands</ms:short_name>
13
+ <ms:code>WMD</ms:code>
14
+ <ms:st_area_shape_>14543741870.84492</ms:st_area_shape_>
15
+ <ms:st_perimeter_shape_>1043376.795941756</ms:st_perimeter_shape_>
16
+ </ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas>
17
+ </gml:featureMember>
18
+ </wfs:FeatureCollection>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
3
+ <gml:boundedBy>
4
+ <gml:Box srsName="EPSG:27700">
5
+ <gml:coordinates>0,0,0,0</gml:coordinates>
6
+ </gml:Box>
7
+ </gml:boundedBy>
8
+ <gml:featureMember>
9
+ <ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas fid="Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas.19">
10
+ <ms:OBJECTID>19</ms:OBJECTID>
11
+ <ms:long_name>Yorkshire</ms:long_name>
12
+ <ms:short_name>Yorkshire</ms:short_name>
13
+ <ms:code>YOR</ms:code>
14
+ <ms:st_area_shape_>14482874597.24499</ms:st_area_shape_>
15
+ <ms:st_perimeter_shape_>820401.3233851442</ms:st_perimeter_shape_>
16
+ </ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas>
17
+ </gml:featureMember>
18
+ <gml:featureMember>
19
+ <ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas fid="Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas.20">
20
+ <ms:OBJECTID>20</ms:OBJECTID>
21
+ <ms:long_name>Greater Manchester Merseyside and Cheshire</ms:long_name>
22
+ <ms:short_name>Gtr Mancs Mersey and Ches</ms:short_name>
23
+ <ms:code>GMC</ms:code>
24
+ <ms:st_area_shape_>4473822349.59001</ms:st_area_shape_>
25
+ <ms:st_perimeter_shape_>543689.9446941023</ms:st_perimeter_shape_>
26
+ </ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas>
27
+ </gml:featureMember>
28
+ </wfs:FeatureCollection>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <ogc:ServiceExceptionReport xmlns:ogc="http://www.opengis.net/ogc" version="1.2.0">
3
+ <ogc:ServiceException><![CDATA[The geometry was not recognized.]]></ogc:ServiceException>
4
+ <ogc:ServiceException><![CDATA[Operator 'Intersects' can't parse geometry.]]></ogc:ServiceException>
5
+ </ogc:ServiceExceptionReport>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
3
+ <gml:boundedBy>
4
+ <gml:Box srsName="EPSG:27700">
5
+ <gml:coordinates>0,0,0,0</gml:coordinates>
6
+ </gml:Box>
7
+ </gml:boundedBy>
8
+ </wfs:FeatureCollection>
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="utf-8" ?>
2
+ <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
3
+ <gml:boundedBy>
4
+ <gml:Box srsName="EPSG:27700">
5
+ <gml:coordinates>0,0,0,0</gml:coordinates>
6
+ </gml:Box>
7
+ </gml:boundedBy>
8
+ <gml:featureMember>
9
+ <ms:Administrative_Boundaries_Water_Management_Areas fid="Administrative_Boundaries_Water_Management_Areas.11">
10
+ <ms:OBJECTID>11</ms:OBJECTID>
11
+ <ms:long_name>Lincolnshire and Northamptonshire</ms:long_name>
12
+ <ms:short_name>Lincs and Northants</ms:short_name>
13
+ <ms:code>LCNNTH</ms:code>
14
+ <ms:area_id>3</ms:area_id>
15
+ <ms:area_name>Northern</ms:area_name>
16
+ <ms:st_area_shape_>9270202427.530003</ms:st_area_shape_>
17
+ <ms:st_perimeter_shape_>1148848.464792307</ms:st_perimeter_shape_>
18
+ </ms:Administrative_Boundaries_Water_Management_Areas>
19
+ </gml:featureMember>
20
+ <gml:featureMember>
21
+ <ms:Administrative_Boundaries_Water_Management_Areas fid="Administrative_Boundaries_Water_Management_Areas.15">
22
+ <ms:OBJECTID>15</ms:OBJECTID>
23
+ <ms:long_name>Staffordshire Warwickshire and West Midlands</ms:long_name>
24
+ <ms:short_name>Staffs Warks and West Mids</ms:short_name>
25
+ <ms:code>STWKWM</ms:code>
26
+ <ms:area_id>29</ms:area_id>
27
+ <ms:area_name>Central</ms:area_name>
28
+ <ms:st_area_shape_>6460280400.1</ms:st_area_shape_>
29
+ <ms:st_perimeter_shape_>759189.708848595</ms:st_perimeter_shape_>
30
+ </ms:Administrative_Boundaries_Water_Management_Areas>
31
+ </gml:featureMember>
32
+ </wfs:FeatureCollection>
@@ -2,10 +2,6 @@
2
2
 
3
3
  RSpec.shared_examples "handle request errors" do
4
4
  context "when there is a problem with the Web Feature Service" do
5
- before(:each) { VCR.turn_off! }
6
- after(:each) { VCR.turn_on! }
7
-
8
- let(:host) { "https://environment.data.gov.uk/" }
9
5
  let(:easting) { 408_602.61 }
10
6
  let(:northing) { 257_535.31 }
11
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defra_ruby_area
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Defra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-29 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.4
19
+ version: 1.11.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.10.4
26
+ version: 1.11.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -138,32 +138,18 @@ dependencies:
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: simplecov
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: vcr
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
143
  - - "~>"
158
144
  - !ruby/object:Gem::Version
159
- version: '4.0'
145
+ version: 0.17.1
160
146
  type: :development
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
150
  - - "~>"
165
151
  - !ruby/object:Gem::Version
166
- version: '4.0'
152
+ version: 0.17.1
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: webmock
169
155
  requirement: !ruby/object:Gem::Requirement
@@ -201,29 +187,26 @@ files:
201
187
  - lib/defra_ruby/area/services/public_face_area_service.rb
202
188
  - lib/defra_ruby/area/services/water_management_area_service.rb
203
189
  - lib/defra_ruby/area/version.rb
204
- - spec/cassettes/public_face_area_invalid_blank.yml
205
- - spec/cassettes/public_face_area_invalid_coords.yml
206
- - spec/cassettes/public_face_area_valid.yml
207
- - spec/cassettes/public_face_area_valid_multiple.yml
208
- - spec/cassettes/water_management_area_invalid_blank.yml
209
- - spec/cassettes/water_management_area_invalid_coords.yml
210
- - spec/cassettes/water_management_area_valid.yml
211
- - spec/cassettes/water_management_area_valid_multiple.yml
212
190
  - spec/defra_ruby/area/area_spec.rb
213
191
  - spec/defra_ruby/area/configuration_spec.rb
214
192
  - spec/defra_ruby/area/response_spec.rb
215
193
  - spec/defra_ruby/area/services/public_face_area_service_spec.rb
216
194
  - spec/defra_ruby/area/services/water_management_area_service_spec.rb
217
195
  - spec/defra_ruby/area_spec.rb
218
- - spec/examples.txt
219
- - spec/fixtures/valid.xml
196
+ - spec/fixtures/public_face_area_invalid_blank.xml
197
+ - spec/fixtures/public_face_area_invalid_coords.xml
198
+ - spec/fixtures/public_face_area_valid.xml
199
+ - spec/fixtures/public_face_area_valid_multiple.xml
200
+ - spec/fixtures/water_management_area_invalid_blank.xml
201
+ - spec/fixtures/water_management_area_invalid_coords.xml
202
+ - spec/fixtures/water_management_area_valid.xml
203
+ - spec/fixtures/water_management_area_valid_multiple.xml
220
204
  - spec/spec_helper.rb
221
205
  - spec/support/defra_ruby_area.rb
222
206
  - spec/support/dotenv.rb
223
207
  - spec/support/pry.rb
224
208
  - spec/support/shared_examples/handle_request_errors.rb
225
209
  - spec/support/simplecov.rb
226
- - spec/support/vcr.rb
227
210
  homepage: https://github.com/DEFRA/defra-ruby-area
228
211
  licenses:
229
212
  - The Open Government Licence (OGL) Version 3
@@ -244,8 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
227
  - !ruby/object:Gem::Version
245
228
  version: '0'
246
229
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.6.13
230
+ rubygems_version: 3.1.2
249
231
  signing_key:
250
232
  specification_version: 4
251
233
  summary: Defra ruby on rails EA administrative area lookup
@@ -257,19 +239,16 @@ test_files:
257
239
  - spec/defra_ruby/area/services/water_management_area_service_spec.rb
258
240
  - spec/defra_ruby/area/services/public_face_area_service_spec.rb
259
241
  - spec/defra_ruby/area_spec.rb
260
- - spec/examples.txt
261
- - spec/cassettes/water_management_area_invalid_coords.yml
262
- - spec/cassettes/public_face_area_invalid_coords.yml
263
- - spec/cassettes/water_management_area_invalid_blank.yml
264
- - spec/cassettes/public_face_area_valid.yml
265
- - spec/cassettes/water_management_area_valid.yml
266
- - spec/cassettes/public_face_area_invalid_blank.yml
267
- - spec/cassettes/public_face_area_valid_multiple.yml
268
- - spec/cassettes/water_management_area_valid_multiple.yml
269
242
  - spec/support/defra_ruby_area.rb
270
243
  - spec/support/simplecov.rb
271
- - spec/support/vcr.rb
272
244
  - spec/support/pry.rb
273
245
  - spec/support/dotenv.rb
274
246
  - spec/support/shared_examples/handle_request_errors.rb
275
- - spec/fixtures/valid.xml
247
+ - spec/fixtures/public_face_area_valid_multiple.xml
248
+ - spec/fixtures/water_management_area_valid_multiple.xml
249
+ - spec/fixtures/public_face_area_invalid_blank.xml
250
+ - spec/fixtures/public_face_area_valid.xml
251
+ - spec/fixtures/water_management_area_valid.xml
252
+ - spec/fixtures/water_management_area_invalid_coords.xml
253
+ - spec/fixtures/public_face_area_invalid_coords.xml
254
+ - spec/fixtures/water_management_area_invalid_blank.xml
@@ -1,49 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E,%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.2.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 22:48:25 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '349'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <ogc:ServiceExceptionReport xmlns:ogc="http://www.opengis.net/ogc" version="1.2.0">
44
- <ogc:ServiceException><![CDATA[The geometry was not recognized.]]></ogc:ServiceException>
45
- <ogc:ServiceException><![CDATA[Operator 'Intersects' can't parse geometry.]]></ogc:ServiceException>
46
- </ogc:ServiceExceptionReport>
47
- http_version:
48
- recorded_at: Wed, 28 Aug 2019 22:48:25 GMT
49
- recorded_with: VCR 4.0.0
@@ -1,52 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E301233.0,221592.0%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.2.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 22:48:25 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '1070'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |-
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
44
- <gml:boundedBy>
45
- <gml:Box srsName="EPSG:27700">
46
- <gml:coordinates>0,0,0,0</gml:coordinates>
47
- </gml:Box>
48
- </gml:boundedBy>
49
- </wfs:FeatureCollection>
50
- http_version:
51
- recorded_at: Wed, 28 Aug 2019 22:48:25 GMT
52
- recorded_with: VCR 4.0.0
@@ -1,62 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E408602.61,257535.31%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.2.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 22:48:25 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '1693'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |-
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
44
- <gml:boundedBy>
45
- <gml:Box srsName="EPSG:27700">
46
- <gml:coordinates>0,0,0,0</gml:coordinates>
47
- </gml:Box>
48
- </gml:boundedBy>
49
- <gml:featureMember>
50
- <ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas fid="Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas.23">
51
- <ms:OBJECTID>23</ms:OBJECTID>
52
- <ms:long_name>West Midlands</ms:long_name>
53
- <ms:short_name>West Midlands</ms:short_name>
54
- <ms:code>WMD</ms:code>
55
- <ms:st_area_shape_>14543741870.84492</ms:st_area_shape_>
56
- <ms:st_perimeter_shape_>1043376.795941756</ms:st_perimeter_shape_>
57
- </ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas>
58
- </gml:featureMember>
59
- </wfs:FeatureCollection>
60
- http_version:
61
- recorded_at: Wed, 28 Aug 2019 22:48:25 GMT
62
- recorded_with: VCR 4.0.0
@@ -1,72 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E398056.684,414748%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.5.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Thu, 29 Aug 2019 09:52:19 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '2348'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |-
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-environment-agency-and-natural-england-public-face-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
44
- <gml:boundedBy>
45
- <gml:Box srsName="EPSG:27700">
46
- <gml:coordinates>0,0,0,0</gml:coordinates>
47
- </gml:Box>
48
- </gml:boundedBy>
49
- <gml:featureMember>
50
- <ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas fid="Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas.19">
51
- <ms:OBJECTID>19</ms:OBJECTID>
52
- <ms:long_name>Yorkshire</ms:long_name>
53
- <ms:short_name>Yorkshire</ms:short_name>
54
- <ms:code>YOR</ms:code>
55
- <ms:st_area_shape_>14482874597.24499</ms:st_area_shape_>
56
- <ms:st_perimeter_shape_>820401.3233851442</ms:st_perimeter_shape_>
57
- </ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas>
58
- </gml:featureMember>
59
- <gml:featureMember>
60
- <ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas fid="Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas.20">
61
- <ms:OBJECTID>20</ms:OBJECTID>
62
- <ms:long_name>Greater Manchester Merseyside and Cheshire</ms:long_name>
63
- <ms:short_name>Gtr Mancs Mersey and Ches</ms:short_name>
64
- <ms:code>GMC</ms:code>
65
- <ms:st_area_shape_>4473822349.59001</ms:st_area_shape_>
66
- <ms:st_perimeter_shape_>543689.9446941023</ms:st_perimeter_shape_>
67
- </ms:Administrative_Boundaries_Environment_Agency_and_Natural_England_Public_Face_Areas>
68
- </gml:featureMember>
69
- </wfs:FeatureCollection>
70
- http_version:
71
- recorded_at: Thu, 29 Aug 2019 09:52:19 GMT
72
- recorded_with: VCR 4.0.0
@@ -1,49 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E,%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Water_Management_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.2.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 22:48:26 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '349'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <ogc:ServiceExceptionReport xmlns:ogc="http://www.opengis.net/ogc" version="1.2.0">
44
- <ogc:ServiceException><![CDATA[The geometry was not recognized.]]></ogc:ServiceException>
45
- <ogc:ServiceException><![CDATA[Operator 'Intersects' can't parse geometry.]]></ogc:ServiceException>
46
- </ogc:ServiceExceptionReport>
47
- http_version:
48
- recorded_at: Wed, 28 Aug 2019 22:48:26 GMT
49
- recorded_with: VCR 4.0.0
@@ -1,52 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E301233.0,221592.0%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Water_Management_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.2.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 22:48:27 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '968'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |-
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
44
- <gml:boundedBy>
45
- <gml:Box srsName="EPSG:27700">
46
- <gml:coordinates>0,0,0,0</gml:coordinates>
47
- </gml:Box>
48
- </gml:boundedBy>
49
- </wfs:FeatureCollection>
50
- http_version:
51
- recorded_at: Wed, 28 Aug 2019 22:48:27 GMT
52
- recorded_with: VCR 4.0.0
@@ -1,64 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E408602.61,257535.31%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Water_Management_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- User-Agent:
13
- - rest-client/2.1.0 (darwin18.2.0 x86_64) ruby/2.4.2p198
14
- Accept-Encoding:
15
- - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 22:48:26 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '1607'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |-
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
44
- <gml:boundedBy>
45
- <gml:Box srsName="EPSG:27700">
46
- <gml:coordinates>0,0,0,0</gml:coordinates>
47
- </gml:Box>
48
- </gml:boundedBy>
49
- <gml:featureMember>
50
- <ms:Administrative_Boundaries_Water_Management_Areas fid="Administrative_Boundaries_Water_Management_Areas.15">
51
- <ms:OBJECTID>15</ms:OBJECTID>
52
- <ms:long_name>Staffordshire Warwickshire and West Midlands</ms:long_name>
53
- <ms:short_name>Staffs Warks and West Mids</ms:short_name>
54
- <ms:code>STWKWM</ms:code>
55
- <ms:area_id>29</ms:area_id>
56
- <ms:area_name>Central</ms:area_name>
57
- <ms:st_area_shape_>6460280400.1</ms:st_area_shape_>
58
- <ms:st_perimeter_shape_>759189.708848595</ms:st_perimeter_shape_>
59
- </ms:Administrative_Boundaries_Water_Management_Areas>
60
- </gml:featureMember>
61
- </wfs:FeatureCollection>
62
- http_version:
63
- recorded_at: Wed, 28 Aug 2019 22:48:26 GMT
64
- recorded_with: VCR 4.0.0
@@ -1,76 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?Filter=(%3CFilter%3E%3CIntersects%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E456330,267000%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Filter%3E)&REQUEST=GetFeature&SERVICE=WFS&SRSName=EPSG:27700&VERSION=1.0.0&propertyName=area_id,area_name,code,long_name,short_name&typeName=ms:Administrative_Boundaries_Water_Management_Areas
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Accept:
11
- - "*/*"
12
- Accept-Encoding:
13
- - gzip, deflate
14
- User-Agent:
15
- - rest-client/2.0.2 (darwin18.2.0 x86_64) ruby/2.4.2p198
16
- Host:
17
- - environment.data.gov.uk
18
- response:
19
- status:
20
- code: 200
21
- message: OK
22
- headers:
23
- Server:
24
- - nginx
25
- Date:
26
- - Wed, 28 Aug 2019 16:25:23 GMT
27
- Content-Type:
28
- - application/xml
29
- Content-Length:
30
- - '2234'
31
- Connection:
32
- - keep-alive
33
- Cache-Control:
34
- - private
35
- X-Aspnet-Version:
36
- - 4.0.30319
37
- X-Powered-By:
38
- - ASP.NET
39
- body:
40
- encoding: UTF-8
41
- string: |-
42
- <?xml version="1.0" encoding="utf-8" ?>
43
- <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ms="https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs https://environment.data.gov.uk/spatialdata/administrative-boundaries-water-management-areas/wfs?service=wfs%26version=1.0.0%26request=DescribeFeatureType">
44
- <gml:boundedBy>
45
- <gml:Box srsName="EPSG:27700">
46
- <gml:coordinates>0,0,0,0</gml:coordinates>
47
- </gml:Box>
48
- </gml:boundedBy>
49
- <gml:featureMember>
50
- <ms:Administrative_Boundaries_Water_Management_Areas fid="Administrative_Boundaries_Water_Management_Areas.11">
51
- <ms:OBJECTID>11</ms:OBJECTID>
52
- <ms:long_name>Lincolnshire and Northamptonshire</ms:long_name>
53
- <ms:short_name>Lincs and Northants</ms:short_name>
54
- <ms:code>LCNNTH</ms:code>
55
- <ms:area_id>3</ms:area_id>
56
- <ms:area_name>Northern</ms:area_name>
57
- <ms:st_area_shape_>9270202427.530003</ms:st_area_shape_>
58
- <ms:st_perimeter_shape_>1148848.464792307</ms:st_perimeter_shape_>
59
- </ms:Administrative_Boundaries_Water_Management_Areas>
60
- </gml:featureMember>
61
- <gml:featureMember>
62
- <ms:Administrative_Boundaries_Water_Management_Areas fid="Administrative_Boundaries_Water_Management_Areas.15">
63
- <ms:OBJECTID>15</ms:OBJECTID>
64
- <ms:long_name>Staffordshire Warwickshire and West Midlands</ms:long_name>
65
- <ms:short_name>Staffs Warks and West Mids</ms:short_name>
66
- <ms:code>STWKWM</ms:code>
67
- <ms:area_id>29</ms:area_id>
68
- <ms:area_name>Central</ms:area_name>
69
- <ms:st_area_shape_>6460280400.1</ms:st_area_shape_>
70
- <ms:st_perimeter_shape_>759189.708848595</ms:st_perimeter_shape_>
71
- </ms:Administrative_Boundaries_Water_Management_Areas>
72
- </gml:featureMember>
73
- </wfs:FeatureCollection>
74
- http_version:
75
- recorded_at: Wed, 28 Aug 2019 16:25:23 GMT
76
- recorded_with: VCR 4.0.0
data/spec/examples.txt DELETED
@@ -1,27 +0,0 @@
1
- example_id | status | run_time |
2
- -------------------------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/defra_ruby/area/area_spec.rb[1:1:1:1] | passed | 0.00012 seconds |
4
- ./spec/defra_ruby/area/area_spec.rb[1:1:2:1] | passed | 0.00145 seconds |
5
- ./spec/defra_ruby/area/area_spec.rb[1:1:3:1] | passed | 0.00082 seconds |
6
- ./spec/defra_ruby/area/configuration_spec.rb[1:1] | passed | 0.0001 seconds |
7
- ./spec/defra_ruby/area/response_spec.rb[1:1:1:1] | passed | 0.00014 seconds |
8
- ./spec/defra_ruby/area/response_spec.rb[1:1:2:1] | passed | 0.00079 seconds |
9
- ./spec/defra_ruby/area/response_spec.rb[1:2:1:1] | passed | 0.00016 seconds |
10
- ./spec/defra_ruby/area/response_spec.rb[1:2:2:1] | passed | 0.00085 seconds |
11
- ./spec/defra_ruby/area/response_spec.rb[1:3:1:1] | passed | 0.00014 seconds |
12
- ./spec/defra_ruby/area/response_spec.rb[1:3:2:1] | passed | 0.00085 seconds |
13
- ./spec/defra_ruby/area/services/public_face_area_service_spec.rb[1:1:1:1] | passed | 0.03742 seconds |
14
- ./spec/defra_ruby/area/services/public_face_area_service_spec.rb[1:1:2:1] | passed | 0.02956 seconds |
15
- ./spec/defra_ruby/area/services/public_face_area_service_spec.rb[1:1:3:1:1] | passed | 0.03033 seconds |
16
- ./spec/defra_ruby/area/services/public_face_area_service_spec.rb[1:1:3:2:1] | passed | 0.02817 seconds |
17
- ./spec/defra_ruby/area/services/public_face_area_service_spec.rb[1:1:4:1:1] | passed | 0.02708 seconds |
18
- ./spec/defra_ruby/area/services/public_face_area_service_spec.rb[1:1:4:2:1] | passed | 0.02668 seconds |
19
- ./spec/defra_ruby/area/services/water_management_area_service_spec.rb[1:1:1:1] | passed | 0.02484 seconds |
20
- ./spec/defra_ruby/area/services/water_management_area_service_spec.rb[1:1:2:1] | passed | 0.03471 seconds |
21
- ./spec/defra_ruby/area/services/water_management_area_service_spec.rb[1:1:3:1:1] | passed | 0.03063 seconds |
22
- ./spec/defra_ruby/area/services/water_management_area_service_spec.rb[1:1:3:2:1] | passed | 0.03441 seconds |
23
- ./spec/defra_ruby/area/services/water_management_area_service_spec.rb[1:1:4:1:1] | passed | 0.02612 seconds |
24
- ./spec/defra_ruby/area/services/water_management_area_service_spec.rb[1:1:4:2:1] | passed | 0.03511 seconds |
25
- ./spec/defra_ruby/area_spec.rb[1:1:1] | passed | 0.00143 seconds |
26
- ./spec/defra_ruby/area_spec.rb[1:2:1:1] | passed | 0.00067 seconds |
27
- ./spec/defra_ruby/area_spec.rb[1:2:2:1] | passed | 0.00066 seconds |
data/spec/support/vcr.rb DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Stubbing HTTP requests
4
- require "webmock/rspec"
5
- # Auto generate fake responses for web-requests
6
- require "vcr"
7
-
8
- VCR.configure do |c|
9
- c.cassette_library_dir = "spec/cassettes"
10
- c.hook_into :webmock
11
-
12
- c.ignore_hosts "127.0.0.1", "codeclimate.com"
13
-
14
- SECONDS_IN_DAY = 24 * 60 * 60
15
-
16
- c.default_cassette_options = { re_record_interval: (14 * SECONDS_IN_DAY) }
17
- end