puppet-debugger 0.19.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +10 -27
- data/.rubocop.yml +64 -232
- data/.rubocop_todo.yml +89 -147
- data/CHANGELOG.md +12 -1
- data/Gemfile +7 -5
- data/README.md +4 -5
- data/Rakefile +11 -12
- data/bin/pdb +1 -1
- data/lib/awesome_print/ext/awesome_puppet.rb +10 -8
- data/lib/plugins/puppet-debugger/input_responders/benchmark.rb +5 -4
- data/lib/plugins/puppet-debugger/input_responders/classes.rb +4 -1
- data/lib/plugins/puppet-debugger/input_responders/classification.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/commands.rb +18 -18
- data/lib/plugins/puppet-debugger/input_responders/datatypes.rb +11 -5
- data/lib/plugins/puppet-debugger/input_responders/environment.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/exit.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/facterdb_filter.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/facts.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/functions.rb +34 -32
- data/lib/plugins/puppet-debugger/input_responders/help.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/krt.rb +4 -2
- data/lib/plugins/puppet-debugger/input_responders/play.rb +22 -24
- data/lib/plugins/puppet-debugger/input_responders/reset.rb +5 -3
- data/lib/plugins/puppet-debugger/input_responders/resources.rb +5 -2
- data/lib/plugins/puppet-debugger/input_responders/set.rb +34 -32
- data/lib/plugins/puppet-debugger/input_responders/stacktrace.rb +23 -0
- data/lib/plugins/puppet-debugger/input_responders/types.rb +6 -2
- data/lib/plugins/puppet-debugger/input_responders/vars.rb +6 -5
- data/lib/plugins/puppet-debugger/input_responders/whereami.rb +5 -3
- data/lib/puppet-debugger/cli.rb +118 -91
- data/lib/puppet-debugger/code/code_file.rb +13 -14
- data/lib/puppet-debugger/code/code_range.rb +5 -3
- data/lib/puppet-debugger/code/loc.rb +1 -1
- data/lib/puppet-debugger/debugger_code.rb +2 -0
- data/lib/puppet-debugger/hooks.rb +15 -16
- data/lib/puppet-debugger/input_responder_plugin.rb +54 -52
- data/lib/puppet-debugger/monkey_patches.rb +4 -1
- data/lib/puppet-debugger/plugin_test_helper.rb +9 -8
- data/lib/puppet-debugger/support.rb +27 -17
- data/lib/puppet-debugger/support/environment.rb +4 -4
- data/lib/puppet-debugger/support/errors.rb +25 -27
- data/lib/puppet-debugger/support/facts.rb +5 -5
- data/lib/puppet-debugger/support/node.rb +4 -5
- data/lib/puppet-debugger/support/scope.rb +19 -17
- data/lib/puppet-debugger/trollop.rb +38 -31
- data/lib/puppet-debugger/version.rb +1 -1
- data/lib/puppet/application/debugger.rb +141 -135
- data/output.json +1 -0
- data/puppet-debugger.gemspec +17 -16
- data/spec/awesome_print/ext/awesome_puppet_spec.rb +30 -30
- data/spec/fixtures/sample_start_debugger.pp +3 -2
- data/spec/hooks_spec.rb +33 -35
- data/spec/input_responder_plugin_spec.rb +7 -6
- data/spec/input_responders/benchmark_spec.rb +3 -1
- data/spec/input_responders/classes_spec.rb +12 -10
- data/spec/input_responders/classification_spec.rb +4 -2
- data/spec/input_responders/commands_spec.rb +2 -0
- data/spec/input_responders/datatypes_spec.rb +4 -3
- data/spec/input_responders/environment_spec.rb +2 -0
- data/spec/input_responders/exit_spec.rb +9 -11
- data/spec/input_responders/facterdb_filter_spec.rb +2 -0
- data/spec/input_responders/facts_spec.rb +2 -0
- data/spec/input_responders/functions_spec.rb +30 -28
- data/spec/input_responders/help_spec.rb +4 -2
- data/spec/input_responders/krt_spec.rb +3 -1
- data/spec/input_responders/play_spec.rb +10 -20
- data/spec/input_responders/reset_spec.rb +2 -0
- data/spec/input_responders/resources_spec.rb +3 -1
- data/spec/input_responders/set_spec.rb +3 -1
- data/spec/input_responders/stacktrace_spec.rb +15 -0
- data/spec/input_responders/types_spec.rb +2 -0
- data/spec/input_responders/vars_spec.rb +4 -4
- data/spec/input_responders/whereami_spec.rb +2 -0
- data/spec/pdb_spec.rb +0 -9
- data/spec/puppet/application/debugger_spec.rb +18 -19
- data/spec/puppet_debugger_spec.rb +81 -84
- data/spec/remote_node_spec.rb +1 -5
- data/spec/spec_helper.rb +22 -18
- data/spec/support_spec.rb +3 -5
- data/test_matrix.rb +1 -1
- metadata +48 -31
data/output.json
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"output":"\"Facts were removed for easier viewing\"\n{\n \"facts\" => \"removed by the puppet-debugger\",\n \"module_name\" => \"\",\n \"name\" => \"main\",\n \"server_facts\" => {\n \"environment\" => \"production\",\n \"serverip\" => \"172.20.5.187\",\n \"servername\" => \"MacBook-Pro-162.local\",\n \"serverversion\" => \"4.10.12\"\n },\n \"title\" => \"main\",\n \"trusted\" => {\n \"authenticated\" => \"local\",\n \"certname\" => nil,\n \"domain\" => nil,\n \"extensions\" => {},\n \"hostname\" => nil\n }\n}\n"}
|
data/puppet-debugger.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require_relative 'lib/puppet-debugger/version'
|
3
4
|
require 'date'
|
4
5
|
|
@@ -7,7 +8,7 @@ Gem::Specification.new do |s|
|
|
7
8
|
s.version = PuppetDebugger::VERSION
|
8
9
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|resources|local_test_results|pec)/}) }
|
9
10
|
s.bindir = 'bin'
|
10
|
-
s.executables = [
|
11
|
+
s.executables = %w[pdb puppet-debugger]
|
11
12
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
12
13
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
13
14
|
if s.respond_to?(:metadata)
|
@@ -26,19 +27,19 @@ Gem::Specification.new do |s|
|
|
26
27
|
'LICENSE.txt',
|
27
28
|
'README.md'
|
28
29
|
]
|
29
|
-
s.required_ruby_version = '>= 2.
|
30
|
-
s.homepage =
|
31
|
-
s.licenses = [
|
32
|
-
s.rubygems_version =
|
33
|
-
s.summary =
|
34
|
-
s.add_runtime_dependency(
|
35
|
-
s.add_runtime_dependency(
|
36
|
-
s.add_runtime_dependency(
|
37
|
-
s.add_runtime_dependency(
|
38
|
-
s.add_runtime_dependency(
|
39
|
-
s.add_runtime_dependency(
|
40
|
-
s.add_runtime_dependency(
|
41
|
-
s.
|
42
|
-
s.add_development_dependency(
|
43
|
-
|
30
|
+
s.required_ruby_version = '>= 2.4'
|
31
|
+
s.homepage = 'https://gitlab.com/puppet-debugger/puppet-debugger'
|
32
|
+
s.licenses = ['MIT']
|
33
|
+
s.rubygems_version = '2.4.5.1'
|
34
|
+
s.summary = 'A repl based debugger for the puppet language'
|
35
|
+
s.add_runtime_dependency('awesome_print', ['~> 1.7'])
|
36
|
+
s.add_runtime_dependency('bundler')
|
37
|
+
s.add_runtime_dependency('facterdb', ['>= 0.4.0'])
|
38
|
+
s.add_runtime_dependency('pluginator', ['~> 1.5.0'])
|
39
|
+
s.add_runtime_dependency('puppet', ['>= 5.5'])
|
40
|
+
s.add_runtime_dependency('rb-readline', ['>= 0.5.5'])
|
41
|
+
s.add_runtime_dependency('table_print', ['>= 1.0.0'])
|
42
|
+
s.add_runtime_dependency('tty-pager', ['~> 0.13.0'])
|
43
|
+
s.add_development_dependency('rdoc', ['~> 3.12'])
|
44
|
+
s.add_development_dependency('rspec', ['~> 3.6'])
|
44
45
|
end
|
@@ -1,37 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'awesome_print'
|
3
|
-
require
|
5
|
+
require 'awesome_print/ext/awesome_puppet'
|
4
6
|
|
5
7
|
RSpec.describe do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
let(:ral_type) do
|
29
|
-
debugger.scope.catalog.resource(resource_type.type_name, resource_type.title).to_ral
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'outputs awesomely' do
|
33
|
-
expect(ral_type.ai).to include('ff:gg')
|
34
|
-
end
|
8
|
+
let(:output) do
|
9
|
+
StringIO.new
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:debugger) do
|
13
|
+
PuppetDebugger::Cli.new(options)
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:options) do
|
17
|
+
{
|
18
|
+
out_buffer: output
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
let(:input) do
|
23
|
+
"notify{'ff:gg': }"
|
24
|
+
end
|
25
|
+
|
26
|
+
let(:resource_type) do
|
27
|
+
debugger.parser.evaluate_string(debugger.scope, input).first
|
28
|
+
end
|
35
29
|
|
30
|
+
let(:ral_type) do
|
31
|
+
debugger.scope.catalog.resource(resource_type.type_name, resource_type.title).to_ral
|
32
|
+
end
|
36
33
|
|
34
|
+
it 'outputs awesomely' do
|
35
|
+
expect(ral_type.ai).to include('ff:gg')
|
36
|
+
end
|
37
37
|
end
|
data/spec/hooks_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'spec_helper'
|
2
4
|
|
3
5
|
describe PuppetDebugger::Hooks do
|
@@ -12,8 +14,8 @@ describe PuppetDebugger::Hooks do
|
|
12
14
|
let(:debugger) do
|
13
15
|
PuppetDebugger::Cli.new(out_buffer: output)
|
14
16
|
end
|
15
|
-
|
16
|
-
describe
|
17
|
+
|
18
|
+
describe 'adding a new hook' do
|
17
19
|
it 'should not execute hook while adding it' do
|
18
20
|
run = false
|
19
21
|
@hooks.add_hook(:test_hook, :my_name) { run = true }
|
@@ -27,12 +29,12 @@ describe PuppetDebugger::Hooks do
|
|
27
29
|
end
|
28
30
|
|
29
31
|
it 'should create a new hook with a block' do
|
30
|
-
@hooks.add_hook(:test_hook, :my_name) {
|
32
|
+
@hooks.add_hook(:test_hook, :my_name) {}
|
31
33
|
expect(@hooks.hook_count(:test_hook)).to eq 1
|
32
34
|
end
|
33
35
|
|
34
36
|
it 'should create a new hook with a callable' do
|
35
|
-
@hooks.add_hook(:test_hook, :my_name, proc {
|
37
|
+
@hooks.add_hook(:test_hook, :my_name, proc {})
|
36
38
|
expect(@hooks.hook_count(:test_hook)).to eq 1
|
37
39
|
end
|
38
40
|
|
@@ -61,8 +63,8 @@ describe PuppetDebugger::Hooks do
|
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
64
|
-
describe
|
65
|
-
describe
|
66
|
+
describe 'PuppetDebugger::Hooks#merge' do
|
67
|
+
describe 'merge!' do
|
66
68
|
it 'should merge in the PuppetDebugger::Hooks' do
|
67
69
|
h1 = PuppetDebugger::Hooks.new.add_hook(:test_hook, :testing) {}
|
68
70
|
h2 = PuppetDebugger::Hooks.new
|
@@ -101,22 +103,19 @@ describe PuppetDebugger::Hooks do
|
|
101
103
|
end
|
102
104
|
|
103
105
|
it 'should preserve hook order' do
|
104
|
-
|
106
|
+
test_hook_name = String.new
|
105
107
|
h1 = PuppetDebugger::Hooks.new
|
106
|
-
h1.add_hook(:test_hook, :testing3) {
|
107
|
-
h1.add_hook(:test_hook, :testing4) {
|
108
|
+
h1.add_hook(:test_hook, :testing3) { test_hook_name << 'h' }
|
109
|
+
h1.add_hook(:test_hook, :testing4) { test_hook_name << 'n' }
|
108
110
|
|
109
111
|
h2 = PuppetDebugger::Hooks.new
|
110
|
-
h2.add_hook(:test_hook, :testing1) {
|
111
|
-
h2.add_hook(:test_hook, :testing2) {
|
112
|
-
|
112
|
+
h2.add_hook(:test_hook, :testing1) { test_hook_name << 'j' }
|
113
|
+
h2.add_hook(:test_hook, :testing2) { test_hook_name << 'o' }
|
113
114
|
h2.merge!(h1)
|
114
|
-
h2.exec_hook(:test_hook)
|
115
|
-
|
116
|
-
expect(name).to eq "john"
|
115
|
+
expect(h2.exec_hook(:test_hook)).to eq 'john'
|
117
116
|
end
|
118
117
|
|
119
|
-
describe
|
118
|
+
describe 'merge' do
|
120
119
|
it 'should return a fresh, independent instance' do
|
121
120
|
h1 = PuppetDebugger::Hooks.new.add_hook(:test_hook, :testing) {}
|
122
121
|
h2 = PuppetDebugger::Hooks.new
|
@@ -146,11 +145,10 @@ describe PuppetDebugger::Hooks do
|
|
146
145
|
expect(h2.get_hook(:test_hook3, :testing)).to eq nil
|
147
146
|
end
|
148
147
|
end
|
149
|
-
|
150
148
|
end
|
151
149
|
end
|
152
150
|
|
153
|
-
describe
|
151
|
+
describe 'dupping a PuppetDebugger::Hooks instance' do
|
154
152
|
it 'should share hooks with original' do
|
155
153
|
@hooks.add_hook(:test_hook, :testing) do
|
156
154
|
:none_such
|
@@ -177,11 +175,10 @@ describe PuppetDebugger::Hooks do
|
|
177
175
|
|
178
176
|
expect(hooks_dup.get_hook(:test_hook, :testing2)).not_to eq @hooks.get_hook(:test_hook, :testing2)
|
179
177
|
end
|
180
|
-
|
181
178
|
end
|
182
179
|
|
183
|
-
describe
|
184
|
-
describe
|
180
|
+
describe 'getting hooks' do
|
181
|
+
describe 'get_hook' do
|
185
182
|
it 'should return the correct requested hook' do
|
186
183
|
run = false
|
187
184
|
fun = false
|
@@ -197,7 +194,7 @@ describe PuppetDebugger::Hooks do
|
|
197
194
|
end
|
198
195
|
end
|
199
196
|
|
200
|
-
describe
|
197
|
+
describe 'get_hooks' do
|
201
198
|
it 'should return a hash of hook names/hook functions for an event' do
|
202
199
|
hook1 = proc { 1 }
|
203
200
|
hook2 = proc { 2 }
|
@@ -215,17 +212,17 @@ describe PuppetDebugger::Hooks do
|
|
215
212
|
end
|
216
213
|
end
|
217
214
|
|
218
|
-
describe
|
215
|
+
describe 'clearing all hooks for an event' do
|
219
216
|
it 'should clear all hooks' do
|
220
|
-
@hooks.add_hook(:test_hook, :my_name) {
|
221
|
-
@hooks.add_hook(:test_hook, :my_name2) {
|
222
|
-
@hooks.add_hook(:test_hook, :my_name3) {
|
217
|
+
@hooks.add_hook(:test_hook, :my_name) {}
|
218
|
+
@hooks.add_hook(:test_hook, :my_name2) {}
|
219
|
+
@hooks.add_hook(:test_hook, :my_name3) {}
|
223
220
|
@hooks.clear_event_hooks(:test_hook)
|
224
221
|
expect(@hooks.hook_count(:test_hook)).to eq 0
|
225
222
|
end
|
226
223
|
end
|
227
224
|
|
228
|
-
describe
|
225
|
+
describe 'deleting a hook' do
|
229
226
|
it 'should successfully delete a hook' do
|
230
227
|
@hooks.add_hook(:test_hook, :my_name) {}
|
231
228
|
@hooks.delete_hook(:test_hook, :my_name)
|
@@ -244,7 +241,7 @@ describe PuppetDebugger::Hooks do
|
|
244
241
|
end
|
245
242
|
end
|
246
243
|
|
247
|
-
describe
|
244
|
+
describe 'executing a hook' do
|
248
245
|
it 'should execute block hook' do
|
249
246
|
run = false
|
250
247
|
@hooks.add_hook(:test_hook, :my_name) { run = true }
|
@@ -264,7 +261,9 @@ describe PuppetDebugger::Hooks do
|
|
264
261
|
obj.instance_variable_set(:@test_var, nil)
|
265
262
|
class << obj
|
266
263
|
attr_accessor :test_var
|
267
|
-
def call
|
264
|
+
def call
|
265
|
+
@test_var = true
|
266
|
+
end
|
268
267
|
end
|
269
268
|
end
|
270
269
|
|
@@ -304,7 +303,7 @@ describe PuppetDebugger::Hooks do
|
|
304
303
|
@hooks.add_hook(:test_hook, :foo2) { raise 'two' }
|
305
304
|
@hooks.add_hook(:test_hook, :foo3) { raise 'three' }
|
306
305
|
@hooks.exec_hook(:test_hook)
|
307
|
-
expect(@hooks.errors.map(&:message)).to eq [
|
306
|
+
expect(@hooks.errors.map(&:message)).to eq %w[one two three]
|
308
307
|
end
|
309
308
|
|
310
309
|
it 'should return the last exception raised as the return value' do
|
@@ -315,15 +314,15 @@ describe PuppetDebugger::Hooks do
|
|
315
314
|
end
|
316
315
|
end
|
317
316
|
|
318
|
-
describe
|
317
|
+
describe 'anonymous hooks' do
|
319
318
|
it 'should allow adding of hook without a name' do
|
320
319
|
@hooks.add_hook(:test_hook, nil) {}
|
321
320
|
expect(@hooks.hook_count(:test_hook)).to eq 1
|
322
321
|
end
|
323
322
|
|
324
323
|
it 'should only allow one anonymous hook to exist' do
|
325
|
-
@hooks.add_hook(:test_hook, nil) {
|
326
|
-
@hooks.add_hook(:test_hook, nil) {
|
324
|
+
@hooks.add_hook(:test_hook, nil) {}
|
325
|
+
@hooks.add_hook(:test_hook, nil) {}
|
327
326
|
expect(@hooks.hook_count(:test_hook)).to eq 1
|
328
327
|
end
|
329
328
|
|
@@ -337,5 +336,4 @@ describe PuppetDebugger::Hooks do
|
|
337
336
|
expect(x).to eq 2
|
338
337
|
end
|
339
338
|
end
|
340
|
-
|
341
|
-
end
|
339
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'puppet-debugger/input_responder_plugin'
|
3
5
|
|
@@ -28,18 +30,17 @@ describe :input_responder_plugin do
|
|
28
30
|
expect(plugin.run([])).to eq([])
|
29
31
|
end
|
30
32
|
|
31
|
-
{scope: Puppet::Parser::Scope, node: Puppet::Node, facts: Puppet::Node::Facts,
|
32
|
-
|
33
|
-
|
33
|
+
{ scope: Puppet::Parser::Scope, node: Puppet::Node, facts: Puppet::Node::Facts,
|
34
|
+
environment: Puppet::Node::Environment,
|
35
|
+
compiler: Puppet::Parser::Compiler, catalog: Puppet::Resource::Catalog }.each do |name, klass|
|
34
36
|
it "can access #{name}" do
|
35
37
|
expect(plugin.send(name).class).to be klass
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
39
|
-
[
|
41
|
+
%i[add_hook handle_input delete_hook handle_input].each do |name|
|
40
42
|
it "responds to method #{name}" do
|
41
43
|
expect(plugin.respond_to?(name)).to eq(true)
|
42
44
|
end
|
43
45
|
end
|
44
|
-
|
45
|
-
end
|
46
|
+
end
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'puppet-debugger'
|
3
5
|
require 'puppet-debugger/plugin_test_helper'
|
4
6
|
|
5
7
|
describe :benchmark do
|
6
8
|
include_examples 'plugin_tests'
|
7
|
-
let(:args) { [
|
9
|
+
let(:args) { ['benchmark', "md5('12345')"] }
|
8
10
|
|
9
11
|
describe 'mode' do
|
10
12
|
before(:each) do
|
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'puppet-debugger'
|
3
5
|
require 'puppet-debugger/plugin_test_helper'
|
4
6
|
|
5
7
|
describe :classes do
|
6
8
|
include_examples 'plugin_tests'
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
let(:input) do
|
10
|
+
'classes'
|
11
|
+
end
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
it 'should be able to print classes' do
|
14
|
+
expect(plugin.run([])).to match(/settings/)
|
15
|
+
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
it 'should be able to print classes with handle input' do
|
18
|
+
debugger_output = /settings/
|
19
|
+
expect(plugin.run(['settings'])).to match(debugger_output)
|
20
|
+
end
|
19
21
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'puppet-debugger'
|
3
5
|
require 'puppet-debugger/plugin_test_helper'
|
@@ -7,11 +9,11 @@ describe :classification do
|
|
7
9
|
let(:args) { [] }
|
8
10
|
|
9
11
|
it 'can process a file' do
|
10
|
-
expect(plugin.run(args)).to eq(
|
12
|
+
expect(plugin.run(args)).to eq('[]')
|
11
13
|
end
|
12
14
|
|
13
15
|
it 'can process a file from handle input' do
|
14
16
|
debugger.handle_input('classification')
|
15
|
-
expect(output.string).to eq("[]\n")
|
17
|
+
expect(output.string).to eq(" => []\n")
|
16
18
|
end
|
17
19
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'puppet-debugger'
|
3
5
|
require 'puppet-debugger/plugin_test_helper'
|
@@ -9,7 +11,7 @@ describe :datatypes do
|
|
9
11
|
it 'handle datatypes' do
|
10
12
|
output = plugin.run(args)
|
11
13
|
if Gem::Version.new(Puppet.version) < Gem::Version.new('4.5.0')
|
12
|
-
expect(output).to eq(
|
14
|
+
expect(output).to eq('[]')
|
13
15
|
else
|
14
16
|
expect(output).to match(/.*Array.*/)
|
15
17
|
end
|
@@ -21,7 +23,6 @@ describe :datatypes do
|
|
21
23
|
else
|
22
24
|
expect(plugin.all_data_types.count).to be >= 30 if supports_datatypes?
|
23
25
|
end
|
24
|
-
|
25
26
|
end
|
26
27
|
|
27
28
|
it 'returns environment datatypes' do
|
@@ -30,6 +31,6 @@ describe :datatypes do
|
|
30
31
|
|
31
32
|
it 'search datatypes' do
|
32
33
|
output = plugin.run(['integer'])
|
33
|
-
expect(output.split(
|
34
|
+
expect(output.split('Integer').count).to be >= 2
|
34
35
|
end
|
35
36
|
end
|