summaryrefslogtreecommitdiffstats
path: root/test/puppet/errortest.rb
Commit message (Collapse)AuthorAgeFilesLines
* maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-061-1/+1
| | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* Code smell: Two space indentationMarkus Roberts2010-07-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced 106806 occurances of ^( +)(.*$) with The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people who learned ruby in the 1900s) uses two-space indentation. 3 Examples: The code: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") becomes: end # Tell getopt which arguments are valid def test_get_getopt_args element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args") The code: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object becomes: assert_equal(str, val) assert_instance_of(Float, result) end # Now test it with a passed object The code: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end becomes: end assert_nothing_raised do klass[:Yay] = "boo" klass["Cool"] = :yayness end
* Changing the test/ classes so that they work from the mainLuke Kanies2007-10-261-1/+1
| | | | | | test/ dir or from their own working dir, like the specs do. This was just a question of changing how their libraries are loaded.
* Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
|
* Fixing the test scripts so that the library pathluke2006-10-161-1/+3
| | | | | | is modified in ruby instead of in the env line git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1793 980ebf18-57e1-0310-9a29-db15c13687c0
* Adding a ruby header to all of the tests so that they can now be executed as ↵luke2006-10-161-0/+2
| | | | | | normal ruby scripts. Using multiple commits because I am having some svn problems. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1791 980ebf18-57e1-0310-9a29-db15c13687c0
* Converting to using the Rakefile for testing. The old 'test' script isluke2006-09-191-8/+1
| | | | | | | | | | | | | now deprecated, and I'll send an email to the dev list and update the docs to reflect that. This still isn't the final solution, because the module structure is a bit weird, but at least it's a starting point, and everything from here on out is small changes, as opposed to large architectural changes. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1632 980ebf18-57e1-0310-9a29-db15c13687c0
* Making some of the metaprogramming a bit more explicit and a bit easier to ↵luke2006-08-201-0/+23
manage. In the process, I have created multiple Util modules, only one of which is used for this current commit. The main work in this commit is that I created a single, common method for dynamically creating classes and moved all of the Class.new users to using this class. It handles a lot of the complexity for me, and most of the users have just a couple of lines of code, now, instead of tens. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1473 980ebf18-57e1-0310-9a29-db15c13687c0