blob: 762116ce96b8820bf7e29cfc81d1892a83be5cad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
test_name "#5027: Issue warnings when using dynamic scope"
step "Apply dynamic scoping manifest on agents"
apply_manifest_on agents, %q{
$foo = 'foo_value'
class a {
$bar = 'bar_value'
include b
}
class b inherits c {
notify { $baz: } # should not generate a warning -- inherited from class c
notify { $bar: } # should generate a warning -- uses dynamic scoping
notify { $foo: } # should not generate a warning -- comes from top scope
}
class c {
$baz = 'baz_value'
}
include a
}
step "Verify deprecation warning"
fail_test "Deprecation warning not issued" unless
stdout.include? 'warning: Dynamic lookup of $bar will not be supported in future versions. Use a fully-qualified variable name or parameterized classes.'
|