Skip to content

Allow to test process parameters#321

Merged
mizzy merged 1 commit into
mizzy:masterfrom
vincentbernat:feature/process
Dec 24, 2013
Merged

Allow to test process parameters#321
mizzy merged 1 commit into
mizzy:masterfrom
vincentbernat:feature/process

Conversation

@vincentbernat

Copy link
Copy Markdown
Contributor

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
```

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what purpose do you define this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@vincentbernat

Copy link
Copy Markdown
Contributor Author

I will send a PR for the documentation today.

@mizzy

mizzy commented Dec 24, 2013

Copy link
Copy Markdown
Owner

Thanks a lot!

@mizzy

mizzy commented Dec 24, 2013

Copy link
Copy Markdown
Owner

Released as v0.14.0.

@mizzy

mizzy commented Mar 27, 2014

Copy link
Copy Markdown
Owner

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

Development

Successfully merging this pull request may close these issues.

2 participants