spec/complete_spec.rb in conjur-cli-5.6.6 vs spec/complete_spec.rb in conjur-cli-6.0.0.rc1
- old
+ new
@@ -1,8 +1,8 @@
require 'spec_helper'
-describe Conjur::CLI::Complete do
+describe Conjur::CLI::Complete, wip: true do
def expects_completions_for string, point=nil
expect(described_class.new("conjur #{string}",point)
.completions
.map { |c| c.chomp ' ' })
end
@@ -26,14 +26,10 @@
context 'with "conjur host l"' do
it { expects_completions_for('host l').to include 'layers',
'list' }
end
-
- context 'with "conjur rubydsl"' do
- it { expects_completions_for('rubydsl ').to include 'load' }
- end
end
describe 'for deprecated subcommands such as `conjur field`' do
it { expects_completions_for('fi').not_to include 'field' }
end
@@ -54,20 +50,10 @@
context 'conjur audit all -' do
it { expects_completions_for('audit all -s -')
.to include '-f', '--follow', '-l', '--limit=',
'-o', '--offset=', '-s', '--short' }
end
-
- context 'conjur layer create --as-' do
- it { expects_completions_for('layer create --as-')
- .to include '--as-role=' }
- end
-
- context 'conjur group create --as-role' do
- it { expects_completions_for('layer create --as-role')
- .to contain_exactly '--as-role=' }
- end
end
describe 'for arguments' do
let (:api) { double('api') }
@@ -106,14 +92,10 @@
}
context 'for a command' do
it { expects_completions_for('group show ')
.to contain_exactly(*groups) }
end
- context 'for a flag' do
- it { expects_completions_for('group create --as-group=')
- .to contain_exactly(*groups) }
- end
end
context 'with kind "layer"' do
before(:each) {
mock_resources { layers.map { |layer| "layer:#{layer}" }}
@@ -173,13 +155,9 @@
end
end
end
describe 'completes mid-line' do
- it 'completes a subcommand not at the end of a line' do
- expect(described_class.new('conjur gr create dwarves/7', 9).completions)
- .to include 'group '
- end
it 'tolerates garbage flags and arguments' do
expect(described_class.new('conjur omg --lol wat pu').completions)
.to include 'pubkeys '
end
end