Skip to content

Snippets and debugging

Tim Zwolak edited this page Apr 18, 2022 · 1 revision
diff --git a/Gemfile b/Gemfile
index 89a35810..9ffcf808 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
 
 # Specify your gem's dependencies in adiwg-mdtranslator.gemspec
 gemspec
+
+# use `bundle exec rake test` to run with gem specified as file path, instead of pubished version
+gem "adiwg-mdjson_schemas", path: "/Users/tim/geoplatform/mdJson-schemas"
+gem "pry"
diff --git a/adiwg-mdtranslator.gemspec b/adiwg-mdtranslator.gemspec
index 0ef8e6e4..b5d38b57 100644
--- a/adiwg-mdtranslator.gemspec
+++ b/adiwg-mdtranslator.gemspec
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
    spec.add_runtime_dependency "thor", "~> 0.19"
    spec.add_runtime_dependency "uuidtools", "~> 2.1"
    spec.add_runtime_dependency "json-schema", "~> 2.7"
-   spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.7"
+   # spec.add_runtime_dependency "adiwg-mdjson_schemas", ">= 2.7"
    spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.8"
    spec.add_runtime_dependency "jbuilder", "~> 2.5"
    spec.add_runtime_dependency "kramdown", "~> 1.13"
diff --git a/test/writers/iso19115-1/tc_19115_1_spatialRepresentation_scope.rb b/test/writers/iso19115-1/tc_19115_1_spatialRepresentation_scope.rb
index bdb9c715..3dc07faf 100644
--- a/test/writers/iso19115-1/tc_19115_1_spatialRepresentation_scope.rb
+++ b/test/writers/iso19115-1/tc_19115_1_spatialRepresentation_scope.rb
@@ -4,6 +4,8 @@
 require_relative '../../helpers/mdJson_hash_objects'
 require_relative '../../helpers/mdJson_hash_functions'
 require_relative 'iso19115_1_test_parent'
+require 'pry'
+require 'nokogiri'
 
 class TestWriter191151SpatialRepresentationScope < TestWriter191151Parent
 
@@ -26,6 +28,22 @@ class TestWriter191151SpatialRepresentationScope < TestWriter191151Parent
                                               '//mdb:spatialRepresentationInfo[1]', 
                                               '//mdb:spatialRepresentationInfo', 0)
 
+
+    # breakpoint, running `bundle exec rake test TEST=test/writers/iso19115-1/tc_19115_1_spatialRepresentation_scope.rb`
+    # will stop here, for inspection 
+    # more info https://pry.github.io/
+    # additional features available here: https://github.com/deivid-rodriguez/pry-byebug#pry-byebug
+    binding.pry
+
+    # given code `TDClass.build_spatialRepresentation_with_scope`
+    # you can get implementation location
+    # TDClass.method(:build_spatialRepresentation_with_scope).source_location
+
+    # parse string to document
+    dExpected =  Nokogiri::XML(hReturn[0], &:noblanks);
+    # writes file "expected" to current working directory (wherever you ran the `rake` command)
+    File.write('expected', dExpected.to_xml);
+
     assert_equal hReturn[0], hReturn[1]
   end
 end
Clone this wiki locally