Skip to content

Commit

Permalink
Merge pull request #230 from dylanratcliffe/pre_condition_escaping
Browse files Browse the repository at this point in the history
Fixed escaping in pre_conditions
  • Loading branch information
dylanratcliffe authored Jun 10, 2019
2 parents a8778ef + d73c7f8 commit 2207ec0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions features/cache.feature
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Feature: Create and maintain a .onceover cache
Then the cache should exist
And the cache should contain all controlrepo files

Scenario: Runnone onnceover in the caching repo
Given control repo "caching"
When I run onceover command "run spec --classes role::webserver"
Then I should not see any errors

Scenario: Creating a new file
Given existing control repo "caching"
When I create a file "example.txt"
Expand Down
2 changes: 1 addition & 1 deletion features/run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ Feature: Run rspec and acceptance test suites
# This test is a full test using my controlrepo. It should remain at the end because it takes ages
Scenario: Run advanced spec tests
Given control repo "puppet_controlrepo"
When I run onceover command "run spec"
When I run onceover command "run spec -p"
Then I should not see any errors
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This should end up exactly the same in the test, backslashes should be
# preserved
$backslashes = '\2'

# Cheak that things haven't been escaped
unless $backslashes[0] == "\\" { fail() }
unless $backslashes[1] == '2' { fail() }
2 changes: 1 addition & 1 deletion templates/test_spec.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe "<%= cls.name %>" do
end
<% end -%>
let(:pre_condition) {
pp = <%= '<<' %>-END
pp = <%= '<<' %>-'END'
$onceover_class = '<%= cls.name %>'
$onceover_node = '<%= node.name %>'

Expand Down

0 comments on commit 2207ec0

Please sign in to comment.