git-hub 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +0,0 @@
1
- $LOAD_PATH.unshift File.dirname(__FILE__)
2
- require 'helper'
3
- require 'fileutils'
4
-
5
- class StandaloneTest < Test::Unit::TestCase
6
- include FileUtils
7
-
8
- def setup
9
- rm "hub" if File.exists? 'hub'
10
- rm_rf "/tmp/_hub_private" if File.exists? '/tmp/_hub_private'
11
- mkdir "/tmp/_hub_private"
12
- chmod 0400, "/tmp/_hub_private"
13
- end
14
-
15
- def teardown
16
- rm "hub" if File.exists? 'hub'
17
- rm_rf "/tmp/_hub_private" if File.exists? "/tmp/_hub_private"
18
- end
19
-
20
- def test_standalone
21
- standalone = Hub::Standalone.build
22
- assert_includes "This file, hub, is generated code", standalone
23
- assert_includes "Runner", standalone
24
- assert_includes "Args", standalone
25
- assert_includes "Commands", standalone
26
- assert_includes ".execute(*ARGV)", standalone
27
- assert_not_includes "module Standalone", standalone
28
-
29
- standalone =~ /__END__\s*(.+)/m
30
- assert_equal File.read('man/hub.1'), $1
31
- end
32
-
33
- def test_standalone_save
34
- Hub::Standalone.save("hub")
35
- assert_equal Hub::Standalone.build, File.read('./hub')
36
- end
37
-
38
- def test_standalone_save_permission_denied
39
- assert_raises Errno::EACCES do
40
- Hub::Standalone.save("hub", "/tmp/_hub_private")
41
- end
42
- end
43
-
44
- def test_standalone_save_doesnt_exist
45
- assert_raises Errno::ENOENT do
46
- Hub::Standalone.save("hub", "/tmp/something/not/real")
47
- end
48
- end
49
- end