Issue #6722 has been updated by Daniel Pittman.

Assignee deleted (Daniel Pittman)

----------------------------------------
Feature #6722: It should be possible to run parser function rspec tests 
individually
https://projects.puppetlabs.com/issues/6722#change-92305

* Author: Dan Bode
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: testing
* Target version: 2.7.0
* Affected Puppet version: 
* Keywords: 
* Branch: 
https://github.com/daniel-pittman/puppet/tree/feature/next/6722-it-should-be-possible-to-run-parser-function-rspec-tests-individually
----------------------------------------
For all rspec tests for functions in Puppet (except extlookup)

it is only possible to run the first test with rspec -l. All other tests will 
fail if run individually.

for example, in defined_spec.rb

<pre>
 13   it "should exist" do
 14     Puppet::Parser::Functions.function("defined").should == 
"function_defined"
 15   end
 16  
 17   it "should be true when the name is defined as a class" do 
 18     @scope.known_resource_types.add Puppet::Resource::Type.new(:hostclass, 
"yayness")
 19     @scope.function_defined("yayness").should be_true
 20   end
</pre>

<pre>
:!rspec -l 13 defined_spec.rb
Run filtered using {:line_number=>13}
.

Finished in 0.00415 seconds
1 example, 0 failures
</pre>

<pre>
:!rspec -l 17 defined_spec.rb
Run filtered using {:line_number=>17}
F

Failures:

  1) the 'defined' function should be true when the name is defined as a class
     Failure/Error: @scope.function_defined("yayness").should be_true
     NoMethodError:
       undefined method `function_defined' for 
#<Puppet::Parser::Scope:0xb78bf210>
     # ./defined_spec.rb:19

Finished in 0.00278 seconds
1 example, 1 failure

shell returned 1
</pre>


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to