44require_relative '../../mocks/puppetdb'
55
66require OctocatalogDiff ::Spec . require_path ( '/catalog' )
7+ require OctocatalogDiff ::Spec . require_path ( '/errors' )
78require OctocatalogDiff ::Spec . require_path ( '/facts' )
89require OctocatalogDiff ::Spec . require_path ( '/util/catalogs' )
910
@@ -92,7 +93,7 @@ def valid?
9293 options = @default_options . merge ( from_env : 'master' )
9394 logger , logger_string = OctocatalogDiff ::Spec . setup_logger
9495 testobj = OctocatalogDiff ::Util ::Catalogs . new ( options , logger )
95- expect { testobj . bootstrap_then_exit } . to raise_error ( OctocatalogDiff ::Util :: Catalogs ::BootstrapError )
96+ expect { testobj . bootstrap_then_exit } . to raise_error ( OctocatalogDiff ::Errors ::BootstrapError )
9697 expect ( logger_string . string ) . to match ( %r{Specify one or more of --bootstrapped-from-dir / --bootstrapped-to-dir} )
9798 end
9899
@@ -105,8 +106,8 @@ def valid?
105106 options = @default_options . merge ( basedir : tmpdir2 , bootstrapped_from_dir : tmpdir1 , from_env : 'asdfasdfasdf' )
106107 logger , logger_string = OctocatalogDiff ::Spec . setup_logger
107108 testobj = OctocatalogDiff ::Util ::Catalogs . new ( options , logger )
108- expect { testobj . bootstrap_then_exit } . to raise_error ( OctocatalogDiff ::Util :: Catalogs ::BootstrapError )
109- expect ( logger_string . string ) . to match ( /ERROR -- : Bootstrap exception: Failed bootstrap_directory for from_dir/ )
109+ expect { testobj . bootstrap_then_exit } . to raise_error ( OctocatalogDiff ::Errors ::BootstrapError )
110+ expect ( logger_string . string ) . to match ( /DEBUG .+ Failed bootstrap from_dir/ )
110111 ensure
111112 OctocatalogDiff ::Spec . clean_up_tmpdir ( tmpdir1 )
112113 OctocatalogDiff ::Spec . clean_up_tmpdir ( tmpdir2 )
@@ -121,8 +122,8 @@ def valid?
121122 options = @default_options . merge ( bootstrapped_from_dir : tmpdir1 , from_env : 'asdfasdfasdf' )
122123 logger , logger_string = OctocatalogDiff ::Spec . setup_logger
123124 testobj = OctocatalogDiff ::Util ::Catalogs . new ( options , logger )
124- expect { testobj . bootstrap_then_exit } . to raise_error ( OctocatalogDiff ::Util :: Catalogs ::BootstrapError )
125- expect ( logger_string . string ) . to match ( /ERROR -- : Bootstrap exception: Failed bootstrap_directory for from_dir/ )
125+ expect { testobj . bootstrap_then_exit } . to raise_error ( OctocatalogDiff ::Errors ::BootstrapError )
126+ expect ( logger_string . string ) . to match ( /DEBUG .+ Failed bootstrap from_dir/ )
126127 ensure
127128 OctocatalogDiff ::Spec . clean_up_tmpdir ( tmpdir1 )
128129 end
@@ -143,7 +144,7 @@ def valid?
143144 @bootstrap_error_message = nil
144145 ENV [ 'PATH' ] = '/usr/sbin:/sbin:/usr/bin:/bin:/usr/local/bin:/usr/local/sbin'
145146 testobj . bootstrap_then_exit
146- rescue OctocatalogDiff ::Util :: Catalogs ::BootstrapError => exc
147+ rescue OctocatalogDiff ::Errors ::BootstrapError => exc
147148 @bootstrap_error_message = "BootstrapError #{ exc } : #{ logger_string . string } "
148149 ensure
149150 ENV [ 'PATH' ] = path_save
@@ -197,7 +198,7 @@ def valid?
197198 logger , _logger_string = OctocatalogDiff ::Spec . setup_logger
198199 testobj = OctocatalogDiff ::Util ::Catalogs . new ( options , logger )
199200 re = %r{ENC.*/asdkfjlfjkalksdfads wasn't found}
200- expect { testobj . catalogs } . to raise_error ( OctocatalogDiff ::Util :: Catalogs ::CatalogError , re )
201+ expect { testobj . catalogs } . to raise_error ( OctocatalogDiff ::Errors ::CatalogError , re )
201202 end
202203 end
203204 end
@@ -210,7 +211,7 @@ def valid?
210211 logger , _logger_string = OctocatalogDiff ::Spec . setup_logger
211212 testobj = OctocatalogDiff ::Util ::Catalogs . new ( options , logger )
212213 re = %r{hiera.yaml.*/asdkfjlfjkalksdfads\) wasn't found}
213- expect { testobj . catalogs } . to raise_error ( OctocatalogDiff ::Util :: Catalogs ::CatalogError , re )
214+ expect { testobj . catalogs } . to raise_error ( OctocatalogDiff ::Errors ::CatalogError , re )
214215 end
215216 end
216217 end
@@ -343,7 +344,7 @@ def valid?
343344 answer = Regexp . new ( lines . join ( '(.|\n)*' ) )
344345 expect do
345346 testobj . send ( :add_parallel_result , result , pcr , key_task_tuple )
346- end . to raise_error ( OctocatalogDiff ::Util :: Catalogs ::CatalogError , answer )
347+ end . to raise_error ( OctocatalogDiff ::Errors ::CatalogError , answer )
347348
348349 expect ( logger_str . string ) . to eq ( '' )
349350 end
0 commit comments