Skip to content

Commit

Permalink
Add a conditional to keep spec test cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
LMacchi committed Mar 23, 2018
1 parent 8786d94 commit 8accd23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/test_spec.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ let!(:<%= function %>) { MockFunction.new('<%= function %>') { |f|
<% test.nodes.each do |node| -%>
context "using fact set <%= node.name %>" do
node_facts = <%= node.fact_set %>
trusted_facts = <%= node.trusted_set %>
let(:facts) { node_facts }
<% if node.trusted_set -%>
trusted_facts = <%= node.trusted_set %>
let(:trusted_facts) { trusted_facts }
<% end -%>
<% if @before_conditions -%>
before :each do
<% @before_conditions.each do |function| -%>
Expand Down

0 comments on commit 8accd23

Please sign in to comment.