Skip to content

Commit

Permalink
Fixup use of conditional pending
Browse files Browse the repository at this point in the history
Without this patch the tests aren't actually getting marked as pending
because exceptions are being raised in the before blocks.  This patch
addresses the problem by switching the declaration references to a lazy
evaluated let method rather than a preemptive before block.  This
prevents the exception and allows the pending methods to execute.
  • Loading branch information
Jeff McCune committed Jan 6, 2013
1 parent 607264a commit 2c220ca
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/unit/network/authstore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,17 @@
"::2:3:4:5:6:7:8",
].each { |ip|
describe "when the pattern is a valid IP such as #{ip}" do
before :each do
@declaration = Puppet::Network::AuthStore::Declaration.new(:allow_ip,ip)
let(:declaration) do
Puppet::Network::AuthStore::Declaration.new(:allow_ip,ip)
end

it "should match the specified IP" do
pending "resolution of ruby issue [7477](http://goo.gl/Bb1LU)", :if => ruby_bug_7477
@declaration.should be_match('www.testsite.org',ip)
declaration.should be_match('www.testsite.org',ip)
end
it "should not match other IPs" do
pending "resolution of ruby issue [7477](http://goo.gl/Bb1LU)", :if => ruby_bug_7477
@declaration.should_not be_match('www.testsite.org','200.101.99.98')
declaration.should_not be_match('www.testsite.org','200.101.99.98')
end
end
}
Expand Down

0 comments on commit 2c220ca

Please sign in to comment.