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

Conversation

Projects
None yet
2 participants
@vincentbernat
Contributor

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.

Vincent Bernat
Allow to test process parameters
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

This comment has been minimized.

@mizzy

mizzy Dec 24, 2013

Owner

For what purpose do you define this?

@mizzy

mizzy Dec 24, 2013

Owner

For what purpose do you define this?

This comment has been minimized.

@vincentbernat

vincentbernat Dec 24, 2013

Contributor

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.

@vincentbernat

vincentbernat Dec 24, 2013

Contributor

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.

This comment has been minimized.

@mizzy

mizzy Dec 24, 2013

Owner

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.

@mizzy

mizzy Dec 24, 2013

Owner

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.

This comment has been minimized.

@vincentbernat

vincentbernat Dec 24, 2013

Contributor

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.

@vincentbernat

vincentbernat Dec 24, 2013

Contributor

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.

This comment has been minimized.

@mizzy

mizzy Dec 24, 2013

Owner

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

mizzy Dec 24, 2013

Owner

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 pull request Dec 24, 2013

@mizzy mizzy merged commit ea044bd into mizzy:master Dec 24, 2013

1 check failed

default The Travis CI build failed
Details
@vincentbernat

This comment has been minimized.

Show comment
Hide comment
@vincentbernat

vincentbernat Dec 24, 2013

Contributor

I will send a PR for the documentation today.

Contributor

vincentbernat commented Dec 24, 2013

I will send a PR for the documentation today.

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 24, 2013

Owner

Thanks a lot!

Owner

mizzy commented Dec 24, 2013

Thanks a lot!

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 24, 2013

Owner

Released as v0.14.0.

Owner

mizzy commented Dec 24, 2013

Released as v0.14.0.

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Mar 27, 2014

Owner

Released as v1.0.0.

Owner

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