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

Feature: Implementation of RFC Attributes #723

Merged
merged 2 commits into from
Jun 14, 2016
Merged

Conversation

chris-rock
Copy link
Contributor

@chris-rock chris-rock commented May 8, 2016

This PR implements parts of RFC Attributes #719

To use it:
$ inspec exec examples/profile-attribute --attrs examples/profile-attribute.yml

An attributes file looks like:

cat examples/profile-attribute.yml 
user: bob
password: secret

The usage within a profile is as following:

val_user = attribute('user', required: true)

describe val_user do
  it { should eq 'johndoe' }
end

@chris-rock chris-rock mentioned this pull request May 8, 2016
@chris-rock chris-rock changed the title WIP: Feature: Attributes WIP: Feature: Implementation of RFC Attributes May 9, 2016
@chris-rock chris-rock changed the title WIP: Feature: Implementation of RFC Attributes Feature: Implementation of RFC Attributes Jun 13, 2016

# that works
describe 'bob' do
it { should eq val_user }
Copy link
Contributor

Choose a reason for hiding this comment

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

Inverting feels more readable:

describe val_user do
  it { should eq 'bob' }

Copy link
Contributor

Choose a reason for hiding this comment

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

ditto vv

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I like that...

@arlimus
Copy link
Contributor

arlimus commented Jun 13, 2016

Awesome work @chris-rock !!

Adding the ncessary tests should round this up.

@chris-rock chris-rock merged commit 2e82edd into master Jun 14, 2016
@chris-rock chris-rock deleted the chris-rock/attributes branch June 14, 2016 01:11
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.

None yet

3 participants