diff options
Diffstat (limited to 'spec/unit/puppet/parser/functions/grep_spec.rb')
-rwxr-xr-x | spec/unit/puppet/parser/functions/grep_spec.rb | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/spec/unit/puppet/parser/functions/grep_spec.rb b/spec/unit/puppet/parser/functions/grep_spec.rb index 97f31a0..d84c401 100755 --- a/spec/unit/puppet/parser/functions/grep_spec.rb +++ b/spec/unit/puppet/parser/functions/grep_spec.rb @@ -2,25 +2,18 @@ require 'spec_helper' describe "the grep function" do - before :all do - Puppet::Parser::Functions.autoloader.loadall - end - - before :each do - @scope = Puppet::Parser::Scope.new - end + let(:scope) { PuppetlabsSpec::PuppetSeams.parser_scope } it "should exist" do Puppet::Parser::Functions.function("grep").should == "function_grep" end it "should raise a ParseError if there is less than 1 arguments" do - lambda { @scope.function_grep([]) }.should( raise_error(Puppet::ParseError)) + lambda { scope.function_grep([]) }.should( raise_error(Puppet::ParseError)) end it "should grep contents from an array" do - result = @scope.function_grep([["aaabbb","bbbccc","dddeee"], "bbb"]) + result = scope.function_grep([["aaabbb","bbbccc","dddeee"], "bbb"]) result.should(eq(["aaabbb","bbbccc"])) end - end |