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

Wrong method in set_cluster_name matcher #342

Closed
krtyyy opened this issue Feb 11, 2016 · 1 comment
Closed

Wrong method in set_cluster_name matcher #342

krtyyy opened this issue Feb 11, 2016 · 1 comment

Comments

@krtyyy
Copy link
Contributor

krtyyy commented Feb 11, 2016

I've been digging around to see if I'm missing something so please feel free to tell me I'm wrong and point me in the right direction.

I've got a recipe that doing the following...

rabbitmq_cluster cluster_nodes do
cluster_name cluster_name
action :set_cluster_name
end

Everything works just fine when we run this on our chef clients. My spec test, which is using
set_cluster_name name to verify that all is well gets an error because my rabbitmq_cluster actions don't include specify :change_cluster_node_type.

The matcher code contains the following...

def set_cluster_name(resource_name) # rubocop:disable AccessorMethodName
ChefSpec::Matchers::ResourceMatcher.new(:rabbitmq_cluster, :change_cluster_node_type, resource_name)
end

Why would :change_cluster_node_type be what the set_cluster_name matcher is looking for? Is that a cut-n-paste error?

Thanks much,

Ken

@krtyyy
Copy link
Contributor Author

krtyyy commented Feb 12, 2016

Update: I modified my local copy of the matcher function to be the following and it worked fine. Is this the correct fix or is there something else going on that I'm missing?

def set_cluster_name(resource_name) # rubocop:disable AccessorMethodName
    ChefSpec::Matchers::ResourceMatcher.new(:rabbitmq_cluster, :set_cluster_name, resource_name)
end

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

1 participant