autobuild 1.10.0.b4 → 1.10.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,38 +0,0 @@
1
- require 'autobuild/test'
2
-
3
- class TC_Subcommand < Minitest::Test
4
- EXAMPLE_1 = <<EOF
5
- This is a file
6
- It will be the first part of the two-part cat
7
- EOF
8
-
9
- EXAMPLE_2 = <<EOF
10
- This is another file
11
- It will be the second part of the two-part cat
12
- EOF
13
- attr_reader :source1, :source2
14
- def setup
15
- super
16
-
17
- Autobuild.logdir = tempdir
18
-
19
- # Write example files
20
- @source1 = File.join(tempdir, 'source1')
21
- @source2 = File.join(tempdir, 'source2')
22
- File.open(source1, 'w+') { |f| f.write(EXAMPLE_1) }
23
- File.open(source2, 'w+') { |f| f.write(EXAMPLE_2) }
24
- end
25
-
26
- def test_behaviour_on_unexpected_error
27
- flexmock(Autobuild::Subprocess).should_receive(:exec).and_raise(::Exception)
28
- assert_raises(Autobuild::SubcommandFailed) { Autobuild::Subprocess.run('test', 'test', 'does_not_exist') }
29
- end
30
- def test_behaviour_on_inexistent_command
31
- assert_raises(Autobuild::SubcommandFailed) { Autobuild::Subprocess.run('test', 'test', 'does_not_exist') }
32
- end
33
- def test_behaviour_on_interrupt
34
- flexmock(Autobuild::Subprocess).should_receive(:exec).and_raise(Interrupt)
35
- assert_raises(Interrupt) { Autobuild::Subprocess.run('test', 'test', 'does_not_exist') }
36
- end
37
- end
38
-