I have a chef cookbook with a library, e.g. library.rb
. It contains a CONSTANT
:
CONSTANT = 'constant'
When I write unit tests for this cookbook, it always gives me the warning:
(Some prefix...)warning: already initialized constant CONSTANT
(Some prefix...)warning: previous definition of CONSTANT was here
The warnings come up repeatedly, as many times as the number of examples (test cases) minus one. I think it is because chefspec loads the libraries once for each example. Could someone tell me how to make the libraries load only once, or how to disable the warning message?