diff options
author | danielsdeleo <dan@getchef.com> | 2014-11-13 15:31:18 -0800 |
---|---|---|
committer | danielsdeleo <dan@getchef.com> | 2014-11-13 15:31:18 -0800 |
commit | 88a210b46a02aa82f8bf80fab7091b23da7720a3 (patch) | |
tree | fc8d5ddc8e62ff9548de2c1f98addb3e16a886cd /spec | |
parent | 5ee467a7da56226a947950464a0f94b6dec5f9a2 (diff) | |
download | chef-88a210b46a02aa82f8bf80fab7091b23da7720a3.tar.gz |
Add another case for chef-dk#227 to ensure regex correctnesschef-dk-227-master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/knife/core/subcommand_loader_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/knife/core/subcommand_loader_spec.rb b/spec/unit/knife/core/subcommand_loader_spec.rb index 695e96457d..df42cff2ea 100644 --- a/spec/unit/knife/core/subcommand_loader_spec.rb +++ b/spec/unit/knife/core/subcommand_loader_spec.rb @@ -88,19 +88,28 @@ describe Chef::Knife::SubcommandLoader do "/opt/chefdk/embedded/apps/chef/lib/chef/knife/bootstrap.rb", "/opt/chefdk/embedded/apps/chef/lib/chef/knife/client_bulk_delete.rb", "/opt/chefdk/embedded/apps/chef/lib/chef/knife/client_create.rb", + # We use the fake version 1.0.0 because that version doesn't exist, # which ensures it won't ever equal "chef-#{Chef::VERSION}" "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/bootstrap.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/client_bulk_delete.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/client_create.rb", + + # Test that we don't accept a version number that is different only in + # trailing characters, e.g. we are running Chef 12.0.0 but there is a + # Chef 12.0.0.rc.0 gem also: + "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-#{Chef::VERSION}.rc.0/lib/chef/knife/thing.rb", + # This command is "extra" compared to what's in the embedded/apps/chef install: "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-1.0.0/lib/chef/knife/data_bag_secret_options.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-vault-2.2.4/lib/chef/knife/decrypt.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/knife-spork-1.4.1/lib/chef/knife/spork-bump.rb", + # These are fake commands that have names designed to test that the # regex is strict enough "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-foo-#{Chef::VERSION}/lib/chef/knife/chef-foo.rb", "/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/foo-chef-#{Chef::VERSION}/lib/chef/knife/foo-chef.rb", + # In a real scenario, we'd use rubygems APIs to only select the most # recent gem, but for this test we want to check that we're doing the # right thing both when the plugin version matches and does not match |