We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd026d3 commit e2fd4afCopy full SHA for e2fd4af
tests/units/test_show.rb
@@ -0,0 +1,20 @@
1
+#!/usr/bin/env ruby
2
+
3
+require File.dirname(__FILE__) + '/../test_helper'
4
5
+class TestShow < Test::Unit::TestCase
6
+ def test_do_not_chomp_contents
7
+ in_temp_dir do
8
+ file_name = 'README.md'
9
+ expected_contents = "hello\nworld\n\n"
10
11
+ g = Git.init
12
+ g.commit('Initial commit', allow_empty: true)
13
+ new_file(file_name, expected_contents)
14
+ g.add(file_name)
15
+ # Show the file from the index by prefixing the file namne with a colon
16
+ contents = g.show(":#{file_name}")
17
+ assert_equal(expected_contents, contents)
18
+ end
19
20
+end
0 commit comments