diff --git a/lib/puppetx/puppetlabs/strings/yard/plugin.rb b/lib/puppetx/puppetlabs/strings/yard/plugin.rb index b71e05e..c518c5e 100644 --- a/lib/puppetx/puppetlabs/strings/yard/plugin.rb +++ b/lib/puppetx/puppetlabs/strings/yard/plugin.rb @@ -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, diff --git a/spec/lib/strings_spec/parsing.rb b/spec/lib/strings_spec/parsing.rb index 9feb61f..6dc2127 100644 --- a/spec/lib/strings_spec/parsing.rb +++ b/spec/lib/strings_spec/parsing.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 725c4f6..655e41f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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 diff --git a/spec/unit/puppetx/puppetlabs/strings/yard/defined_type_handler_spec.rb b/spec/unit/puppetx/puppetlabs/strings/yard/defined_type_handler_spec.rb index f491d01..955070f 100644 --- a/spec/unit/puppetx/puppetlabs/strings/yard/defined_type_handler_spec.rb +++ b/spec/unit/puppetx/puppetlabs/strings/yard/defined_type_handler_spec.rb @@ -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 diff --git a/spec/unit/puppetx/puppetlabs/strings/yard/host_class_handler_spec.rb b/spec/unit/puppetx/puppetlabs/strings/yard/host_class_handler_spec.rb index 3156962..e100fdb 100644 --- a/spec/unit/puppetx/puppetlabs/strings/yard/host_class_handler_spec.rb +++ b/spec/unit/puppetx/puppetlabs/strings/yard/host_class_handler_spec.rb @@ -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 diff --git a/spec/unit/puppetx/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb b/spec/unit/puppetx/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb index b20f049..4ba9e3b 100644 --- a/spec/unit/puppetx/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb +++ b/spec/unit/puppetx/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb @@ -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 diff --git a/spec/unit/puppetx/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb b/spec/unit/puppetx/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb index a8dc853..d35e33e 100644 --- a/spec/unit/puppetx/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb +++ b/spec/unit/puppetx/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb @@ -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