File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ def ensure_open!
4040 end
4141
4242 def prolog_and_opening_tag
43- "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <users>\n "
43+ tag = "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n "
44+ tag += "<!-- GIT_COMMIT:#{ ENV [ 'GIT_COMMIT' ] } -->\n "
45+ tag += "<users>\n "
46+ tag
4447 end
4548
4649 def ensure_io ( file )
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!-- GIT_COMMIT:LOCAL_TESTING -->
23<users >
34<user >
45 <record_type >PUBLIC</record_type >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!-- GIT_COMMIT:LOCAL_TESTING -->
23<users >
34<user >
45 <record_type >PUBLIC</record_type >
Original file line number Diff line number Diff line change 3737 Alma ::XMLWriter . open ( out ) { |w | w . write ( @student_rec ) }
3838 actual = File . read ( out )
3939 xml = Alma ::XMLBuilder . new ( @student_rec ) . build
40- expected = "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <users>\n #{ xml } \n </users>"
40+ expected = "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <!-- GIT_COMMIT:LOCAL_TESTING --> \n < users>\n #{ xml } \n </users>"
4141 expect ( actual ) . to eq ( expected )
4242 end
4343 end
5151 actual = File . read ( out )
5252
5353 xml = Alma ::XMLBuilder . new ( @student_rec ) . build
54- expected = "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <users>\n #{ xml } \n </users>"
54+ expected = "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>\n <!-- GIT_COMMIT:LOCAL_TESTING --> \n < users>\n #{ xml } \n </users>"
5555
5656 expect ( actual ) . to eq ( expected )
5757 end
Original file line number Diff line number Diff line change 3636#
3737# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
3838RSpec . configure do |config |
39+ # Mock ENVs for testing
40+ config . before ( :each ) do
41+ ENV [ 'GIT_COMMIT' ] = 'LOCAL_TESTING'
42+ end
43+
3944 config . color = true
4045 config . tty = true
4146 config . formatter = :documentation
You can’t perform that action at this time.
0 commit comments