(PDOC-3) Make references to YARD explicit
The specs were including YARD into the Kernel, which allowed shorter references to the Registry, but also obscured that the Registry is part of YARD.
This commit is contained in:
		
							parent
							
								
									5159a7b778
								
							
						
					
					
						commit
						14571c098d
					
				|  | @ -1,7 +1,7 @@ | |||
| require 'puppet' | ||||
| require 'puppetx/puppetlabs/strings/yard/monkey_patches' | ||||
| require 'puppetx/puppetlabs/strings/yard/parser' | ||||
| require 'puppetx/puppetlabs/strings/yard/handlers' | ||||
| require 'puppetx/puppetlabs/strings' | ||||
| 
 | ||||
| YARD::Parser::SourceParser.register_parser_type(:puppet, | ||||
|   Puppetx::PuppetLabs::Strings::YARD::PuppetParser, | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ module StringsSpec | |||
|     # Cleans up the Registry and gives YARD some source code | ||||
|     # to generate documentation for | ||||
|     def parse(string, parser = :ruby) | ||||
|       Registry.clear | ||||
|       YARD::Registry.clear | ||||
|       YARD::Parser::SourceParser.parse_string(string, parser) | ||||
|     end | ||||
| 
 | ||||
|  |  | |||
|  | @ -5,9 +5,7 @@ require 'mocha' | |||
| require 'puppet' | ||||
| require 'rspec' | ||||
| 
 | ||||
| # This is neeeded so we can access a Registry if YARD creates one | ||||
| require 'puppetx/puppetlabs/strings/yard/plugin' | ||||
| include YARD | ||||
| require 'puppetx/puppetlabs/strings' | ||||
| 
 | ||||
| RSpec.configure do |config| | ||||
|     config.mock_with :mocha | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ describe Puppetx::PuppetLabs::Strings::YARD::Handlers::DefinedTypeHandler do | |||
|   include StringsSpec::Parsing | ||||
| 
 | ||||
|   def the_definedtype() | ||||
|     Registry.at("foo::bar") | ||||
|     YARD::Registry.at("foo::bar") | ||||
|   end | ||||
| 
 | ||||
|   it "should parse single-line documentation strings before a given defined type" do | ||||
|  | @ -56,6 +56,6 @@ describe Puppetx::PuppetLabs::Strings::YARD::Handlers::DefinedTypeHandler do | |||
| 
 | ||||
|     parse(puppet_code, :puppet) | ||||
| 
 | ||||
|     expect(Registry.all).to be_empty | ||||
|     expect(YARD::Registry.all).to be_empty | ||||
|   end | ||||
| end | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ describe Puppetx::PuppetLabs::Strings::YARD::Handlers::HostClassHandler do | |||
|   include StringsSpec::Parsing | ||||
| 
 | ||||
|   def the_hostclass() | ||||
|     Registry.at("foo::bar") | ||||
|     YARD::Registry.at("foo::bar") | ||||
|   end | ||||
| 
 | ||||
|   it "should parse single-line documentation strings before a given class" do | ||||
|  |  | |||
|  | @ -6,11 +6,11 @@ describe Puppetx::PuppetLabs::Strings::YARD::Handlers::Puppet3xFunctionHandler d | |||
|   include StringsSpec::Parsing | ||||
| 
 | ||||
|   def the_method() | ||||
|     Registry.at("Puppet3xFunctions#the_function") | ||||
|     YARD::Registry.at("Puppet3xFunctions#the_function") | ||||
|   end | ||||
| 
 | ||||
|   def the_namespace() | ||||
|     Registry.at("Puppet3xFunctions") | ||||
|     YARD::Registry.at("Puppet3xFunctions") | ||||
|   end | ||||
| 
 | ||||
|   it "should parse single-line documentation strings before a given function" do | ||||
|  |  | |||
|  | @ -6,11 +6,11 @@ describe Puppetx::PuppetLabs::Strings::YARD::Handlers::Puppet4xFunctionHandler d | |||
|   include StringsSpec::Parsing | ||||
| 
 | ||||
|   def the_method() | ||||
|     Registry.at("Puppet4xFunctions#the_function") | ||||
|     YARD::Registry.at("Puppet4xFunctions#the_function") | ||||
|   end | ||||
| 
 | ||||
|   def the_namespace() | ||||
|     Registry.at("Puppet4xFunctions") | ||||
|     YARD::Registry.at("Puppet4xFunctions") | ||||
|   end | ||||
| 
 | ||||
|   it "should parse single-line documentation strings before a given function" do | ||||
|  | @ -60,6 +60,6 @@ describe Puppetx::PuppetLabs::Strings::YARD::Handlers::Puppet4xFunctionHandler d | |||
|         This is not ruby code | ||||
|     RUBY | ||||
| 
 | ||||
|     expect(Registry.all).to be_empty | ||||
|     expect(YARD::Registry.all).to be_empty | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Hailee Kenney
						Hailee Kenney