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

add describe.one: collection of tests with at least one passing #497

Merged
merged 4 commits into from
Feb 25, 2016

Conversation

arlimus
Copy link
Contributor

@arlimus arlimus commented Feb 25, 2016

This also includes:

  • start the separation of expect and describe statements (i.e. give them their own file to be found more easily)
  • bugfix: a global describe call without a block has resultet in a nil-checking failure

Next steps will have to target the example group structure, which is still bound to RSpec (last remaining close coupling) and the underlying check/test-registry.

i.e. make sure it doesnt crash just because no block was given due to source/line detection.

also return the result of the rule's delegated describe call and not the rule itself to the outer method. this is for consistency (and the following commits)
@arlimus arlimus added the Type: Enhancement Improves an existing feature label Feb 25, 2016
@arlimus arlimus self-assigned this Feb 25, 2016
```
describe.one do
  describe command("uname -r").stdout do
    it { should_not match /x86_64/ }
  end
  describe test_sth_for_x64_processors do
    ...
  end
end
```
@chris-rock
Copy link
Contributor

Tested and works.

$ cat <<EOF >> test.rb
describe.one do
  describe file('/tmp') do
    it { should be_file }
  end
  describe file('/tmp') do
    it { should be_directory }
  end
end
EOF
$ inspec exec test.rb
.

Finished in 0.00059 seconds (files took 0.50709 seconds to load)
1 example, 0 failures

Crazy stuff. 🀄 Thanks @arlimus for bringing this to inspec.

chris-rock added a commit that referenced this pull request Feb 25, 2016
add `describe.one`: collection of tests with at least one passing
@chris-rock chris-rock merged commit 0feff81 into master Feb 25, 2016
@chris-rock chris-rock deleted the dr/or branch February 25, 2016 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants