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

Allow to test process parameters #321

Merged
merged 1 commit into from Dec 24, 2013
Merged

Conversation

@vincentbernat
Copy link
Contributor

@vincentbernat vincentbernat commented Dec 23, 2013

Any parameter that can be queried with ps can be used for tests. For
example:

describe process("memcached") do
  its(:args) { should match /-c 30000\b/ }
end

There is a commit needed in specinfra for this to work. Moreover, I had to define to_ary in Process class. I don't know how Cgroup class got to work without it.

Any parameter that can be queried with `ps` can be used for tests. For
example:

```
describe process("memcached") do
  its(:args) { should match /-c 30000\b/ }
end
```

def to_ary
["process", @name]
end
Copy link
Owner

@mizzy mizzy Dec 24, 2013

For what purpose do you define this?

Copy link
Contributor Author

@vincentbernat vincentbernat Dec 24, 2013

If I don't define it, I cannot use --format json or --format html for reports. It is used to get the description of the test right. I didn't look at RSpec, but I suppose that if the class doesn't respond to this message, it will build something from its name. So, maybe this could be moved in the base class instead.

Copy link
Owner

@mizzy mizzy Dec 24, 2013

What rspec version do you use?

I ran a test with rspec v2.14.7 and saw the html report, but I could not see the difference between with to_ary and without to_ary.

I'd like to check the behavior.Please tell me the rspec version you use.

So, maybe this could be moved in the base class instead.

I think so, too.

Copy link
Contributor Author

@vincentbernat vincentbernat Dec 24, 2013

I am using RSpec 2.14.7. Try the JSON report, I am sure that it was needed for it. If you cannot reproduce the issue, I will provide a backtrace.

Copy link
Owner

@mizzy mizzy Dec 24, 2013

Thanks. --format json causes the error without to_ary. I got it.

I will move it to the base class after merging this pull request.

mizzy added a commit that referenced this issue Dec 24, 2013
@mizzy mizzy merged commit ea044bd into mizzy:master Dec 24, 2013
1 check failed
@vincentbernat
Copy link
Contributor Author

@vincentbernat vincentbernat commented Dec 24, 2013

I will send a PR for the documentation today.

@mizzy
Copy link
Owner

@mizzy mizzy commented Dec 24, 2013

Thanks a lot!

@mizzy
Copy link
Owner

@mizzy mizzy commented Dec 24, 2013

Released as v0.14.0.

@mizzy
Copy link
Owner

@mizzy mizzy commented Mar 27, 2014

Released as v1.0.0.

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