diff options
| author | Luke Kanies <luke@madstop.com> | 2008-02-12 22:47:40 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-02-12 22:47:40 -0600 |
| commit | cb5def4dc3310e1e697b3b27e7163224857c4c61 (patch) | |
| tree | ec408a5c96ed5d8dfdb09c927bd89580d8e0b762 | |
| parent | eb740336d418273eea726f653280dae7553da605 (diff) | |
| download | puppet-cb5def4dc3310e1e697b3b27e7163224857c4c61.tar.gz puppet-cb5def4dc3310e1e697b3b27e7163224857c4c61.tar.xz puppet-cb5def4dc3310e1e697b3b27e7163224857c4c61.zip | |
'rake' within the spec dir works now, anyway, which is
a good start. Autotest still doesn't work, though.
| -rw-r--r-- | lib/puppet/indirector/terminus.rb | 1 | ||||
| -rw-r--r-- | spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb | 14 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 21 | ||||
| -rwxr-xr-x | spec/unit/indirector/rest.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/parser/ast/definition.rb | 8 | ||||
| -rwxr-xr-x | spec/unit/parser/lexer.rb | 4 |
6 files changed, 27 insertions, 23 deletions
diff --git a/lib/puppet/indirector/terminus.rb b/lib/puppet/indirector/terminus.rb index a0623b284..3015c8a37 100644 --- a/lib/puppet/indirector/terminus.rb +++ b/lib/puppet/indirector/terminus.rb @@ -66,6 +66,7 @@ class Puppet::Indirector::Terminus subclass.terminus_type = self.name # Our subclass is specifically associated with an indirection. + raise("Invalid name %s" % longname) unless names.length > 0 indirection_name = names.pop.sub(/^[A-Z]/) { |i| i.downcase }.gsub(/[A-Z]/) { |i| "_" + i.downcase }.intern if indirection_name == "" or indirection_name.nil? diff --git a/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb b/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb index 3152c1bda..e2f3d4728 100644 --- a/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +++ b/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb @@ -11,12 +11,16 @@ require 'puppettest/runnable_test' module Spec module Runner class ExampleGroupRunner - def run_behaviours - @behaviours.each do |behaviour| - # LAK:NOTE: this 'runnable' test is Puppet-specific. - next unless behaviour.runnable? - behaviour.run(@options.reporter, @options.dry_run, @options.reverse, @options.timeout) + def run + prepare + success = true + example_groups.each do |example_group| + next unless example_group.runnable? + success = success & example_group.run end + return success + ensure + finish end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 97ab007b0..db14b47cb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,19 +19,18 @@ require 'puppettest/runnable_test' require 'mocha' require 'spec' +# load any monkey-patches +Dir["#{dir}/monkey_patches/*.rb"].map { |file| require file } Spec::Runner.configure do |config| config.mock_with :mocha - config.prepend_before :all do - setup_mocks_for_rspec - setup() if respond_to? :setup - end - - config.prepend_after :all do - teardown() if respond_to? :teardown - end +# config.prepend_before :all do +# setup_mocks_for_rspec +# setup() if respond_to? :setup +# end +# +# config.prepend_after :all do +# teardown() if respond_to? :teardown +# end end - -# load any monkey-patches -Dir["#{dir}/monkey_patches/*.rb"].map { |file| require file } diff --git a/spec/unit/indirector/rest.rb b/spec/unit/indirector/rest.rb index cf29577b9..3c4716dc8 100755 --- a/spec/unit/indirector/rest.rb +++ b/spec/unit/indirector/rest.rb @@ -13,7 +13,7 @@ describe Puppet::Indirector::REST do @rest_class = Class.new(Puppet::Indirector::REST) do def self.to_s - "Testing" + "This::Is::A::Test::Class" end end diff --git a/spec/unit/parser/ast/definition.rb b/spec/unit/parser/ast/definition.rb index f236e23b7..a58e4d00e 100755 --- a/spec/unit/parser/ast/definition.rb +++ b/spec/unit/parser/ast/definition.rb @@ -45,7 +45,7 @@ describe Puppet::Parser::AST::Definition, "when evaluating" do # # it "should evaluate the associated code with the new scope" - def test_initialize + def old_test_initialize parser = mkparser # Create a new definition @@ -67,7 +67,7 @@ describe Puppet::Parser::AST::Definition, "when evaluating" do end - def test_evaluate + def oldtest_evaluate parser = mkparser config = mkcompiler config.send(:evaluate_main) @@ -135,7 +135,7 @@ describe Puppet::Parser::AST::Definition, "when evaluating" do end # #539 - definitions should support both names and titles - def test_names_and_titles + def oldtest_names_and_titles parser = mkparser scope = mkscope :parser => parser @@ -186,7 +186,7 @@ describe Puppet::Parser::AST::Definition, "when evaluating" do # Testing the root cause of #615. We should be using the fqname for the type, instead # of just the short name. - def test_fully_qualified_types + def oldtest_fully_qualified_types parser = mkparser klass = parser.newclass("one::two") diff --git a/spec/unit/parser/lexer.rb b/spec/unit/parser/lexer.rb index cddbef1ed..9972f7268 100755 --- a/spec/unit/parser/lexer.rb +++ b/spec/unit/parser/lexer.rb @@ -11,11 +11,11 @@ describe Puppet::Parser::Lexer::Token do [:regex, :name, :string, :skip, :incr_line, :skip_text].each do |param| it "should have a #{param.to_s} reader" do - @token.should respond_to?(param) + @token.should be_respond_to(param) end it "should have a #{param.to_s} writer" do - @token.should respond_to?(param.to_s + "=") + @token.should be_respond_to(param.to_s + "=") end end end |
