File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {
2+ "apt_update_last_success" :1458162123 ,
3+ "architecture" :" amd64" ,
4+ "datacenter" :" xyz" ,
5+ "fqdn" :" rspec-node.xyz.github.net" ,
6+ "math" :" 1+2=3" ,
7+ "percent" :" 25%20=5" ,
8+ "_timestamp" :" 2014-12-02 14:56:20 -0600"
9+ }
Original file line number Diff line number Diff line change 1+ # --- !ruby/object:Puppet::Node::Facts
2+ name : rspec-node.xyz.github.net
3+ values :
4+ apt_update_last_success : 1458162123
5+ architecture : amd64
6+ datacenter : xyz
7+ fqdn : rspec-node.xyz.github.net
8+ math : " 1+2=3"
9+ percent : " 25%20=5"
10+ " _timestamp " : 2014-12-02 12:56:20.865795 -08:00
11+ expiration : 2014-12-02 13:11:20.521667 -08:00
Original file line number Diff line number Diff line change 1111 node : 'foo' ,
1212 branch : 'foobranch' ,
1313 puppet_master : 'fake-puppetmaster.non-existent-domain.com' ,
14- fact_file : OctocatalogDiff ::Spec . fixture_path ( 'facts/facts .yaml' )
14+ fact_file : OctocatalogDiff ::Spec . fixture_path ( 'facts/facts_esc .yaml' )
1515 }
1616 end
1717
9999 end
100100
101101 it 'should post the correct facts to HTTParty' do
102- answer = JSON . parse ( File . read ( OctocatalogDiff ::Spec . fixture_path ( 'facts/facts .json' ) ) )
102+ answer = JSON . parse ( File . read ( OctocatalogDiff ::Spec . fixture_path ( 'facts/facts_esc .json' ) ) )
103103 answer . delete ( '_timestamp' )
104104 result = JSON . parse ( @post_data [ 'facts' ] ) [ 'values' ]
105105 expect ( result ) . to eq ( answer )
118118 it 'should log correctly' do
119119 logs = @logger_str . string
120120 expect ( logs ) . to match ( /Start retrieving facts for foo from OctocatalogDiff::Catalog::PuppetMaster/ )
121- expect ( logs ) . to match ( %r{Retrieving facts from.*fixtures/facts/facts .yaml} )
122- expect ( logs ) . to match ( %r{Retrieving facts from.*fixtures/facts/facts .yaml} )
121+ expect ( logs ) . to match ( %r{Retrieving facts from.*fixtures/facts/facts_esc .yaml} )
122+ expect ( logs ) . to match ( %r{Retrieving facts from.*fixtures/facts/facts_esc .yaml} )
123123
124124 answer = Regexp . new ( "Retrieve catalog from #{ api_url [ api_version ] } environment foobranch" )
125125 expect ( logs ) . to match ( answer )
You can’t perform that action at this time.
0 commit comments