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

Added support for colons in section names #5

Merged
merged 3 commits into from
Sep 4, 2012
Merged

Added support for colons in section names #5

merged 3 commits into from
Sep 4, 2012

Conversation

jtopjian
Copy link
Contributor

I'm using this module with some OpenStack components. The ini files contain sections such as

[filter:authtoken]

I have not updated the spec tests to account for this change, though.

@cprice404
Copy link

Thanks for the submission. Seems totally reasonable, and I'll merge it as soon as I get a chance to update the tests... or if you get there before I do and want to add a commit, that would be great too.

@jtopjian
Copy link
Contributor Author

jtopjian commented Sep 2, 2012

@cprice-puppet So I figured I'd try my luck at writing some spec tests, but can't get the existing tests to pass. I get the following errors:

  1) Puppet::Util::IniFile when parsing a file should parse the correct number of sections
     Failure/Error: File.should_receive(:file?).with("/my/ini/file/path") { true }
     NoMethodError:
       undefined method `should_receive' for File:Class
     # ./spec/unit/puppet/util/ini_file_spec.rb:8

There's multiple occurrences of it. Any idea?

Thanks,
Joe

@cprice404
Copy link

Hey Joe,

Thanks for your patience and persistence! I've had a note on my TODO list to come back around to this but haven't had a chance yet.

That error looks like you are just missing some gems. I believe that rspec-expecatations and rspec-mocks should cover it. Let me know if that doesn't get you past it!

@jtopjian
Copy link
Contributor Author

jtopjian commented Sep 4, 2012

@cprice-puppet Thanks, Chris. I have the current gems installed:

rspec (2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.2)
rspec-mocks (2.11.2)
rspec-puppet (0.1.4)

I should simply be running rspec from inside /etc/puppet/modules/inifile, right?

@cprice404
Copy link

Hi Joe,

I just upgraded to the latest version of puppetlabs_spec_helper and all of the gems that you listed above, and I am seeing those same failures. Not sure what changed in those dependencies since the older versions that I was using worked, but, we ought to fix it :)

You should be able to fix it by adding the following to the end of the file inifile/spec/spec_helper.rb:

RSpec.configure do |config|
  config.mock_with :rspec
end

@jtopjian
Copy link
Contributor Author

jtopjian commented Sep 4, 2012

@cprice-puppet That did the trick, thanks! I have added some tests.

@cprice404
Copy link

Awesome, thank you

cprice404 added a commit that referenced this pull request Sep 4, 2012
Added support for colons in section names
@cprice404 cprice404 merged commit 310a4b1 into puppetlabs:master Sep 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants