Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messy ChefSpec tests with artifacts (previos definition of ... was here) #165

Open
joerg opened this issue Sep 1, 2015 · 1 comment
Open

Comments

@joerg
Copy link

joerg commented Sep 1, 2015

When testing any recipes/cookbook with ChefSpec that uses artifacts there are a lot of warnings about "previous definition of ... was here":

./tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:3: warning: already initialized constant Chef::Artifact::DATA_BAG
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:3: warning: previous definition of DATA_BAG was here
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:4: warning: already initialized constant Chef::Artifact::WILDCARD_DATABAG_ITEM
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:4: warning: previous definition of WILDCARD_DATABAG_ITEM was here
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:5: warning: already initialized constant Chef::Artifact::DATA_BAG_NEXUS
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:5: warning: previous definition of DATA_BAG_NEXUS was here
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:6: warning: already initialized constant Chef::Artifact::DATA_BAG_AWS
/tmp/chef/cache/cookbooks/artifact/libraries/chef_artifact.rb:6: warning: previous definition of DATA_BAG_AWS was here

For me these warnings fill about 3 to 4 screens for each run.

This could easily be fixed with rubys OrEquals operator:

    DATA_BAG ||= "artifact"
    WILDCARD_DATABAG_ITEM ||= "_wildcard"
    DATA_BAG_NEXUS ||= 'nexus'
    DATA_BAG_AWS ||= 'aws'
@maoueh
Copy link

maoueh commented Sep 3, 2015

Fixed by #164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants