dia 1.5 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE → COPYING} +0 -0
- data/README.mkd +67 -0
- data/dia.gemspec +49 -0
- data/lib/dia.rb +11 -8
- data/lib/dia/application.rb +49 -0
- data/lib/dia/exception_struct.rb +7 -0
- data/lib/dia/exceptions.rb +5 -0
- data/lib/dia/functions.rb +8 -0
- data/lib/dia/profiles.rb +2 -6
- data/lib/dia/ruby_block.rb +319 -0
- data/lib/dia/shared_features.rb +91 -0
- data/test/setup.rb +5 -4
- data/test/suite/lib/dia/exception_struct.rb +40 -0
- data/test/suite/lib/dia/ruby_block.rb +561 -0
- data/test/suite/lib/dia/shared_features.rb +236 -0
- metadata +31 -42
- data/.yardopts +0 -4
- data/HACKING.md +0 -13
- data/NEWS.md +0 -61
- data/README.md +0 -170
- data/TODO.md +0 -8
- data/lib/dia/commonapi.rb +0 -7
- data/lib/dia/sandbox.rb +0 -208
- data/test/suite/check_if_sandbox_is_alive_test.rb +0 -29
- data/test/suite/exception()_test.rb +0 -55
- data/test/suite/exception_raised?_test.rb +0 -22
- data/test/suite/exceptions_test.rb +0 -12
- data/test/suite/exit_status_test.rb +0 -16
- data/test/suite/passing_parameters_to_constructer_test.rb +0 -34
- data/test/suite/run_block_in_sandbox_test.rb +0 -132
- data/test/suite/terminate_sandbox_test.rb +0 -29
@@ -1,29 +0,0 @@
|
|
1
|
-
BareTest.suite 'Dia::Sandbox#terminate', :tags => [ :terminate ] do
|
2
|
-
|
3
|
-
assert 'A spawned sandbox will be terminated with the #terminate method' do
|
4
|
-
sandbox = Dia::Sandbox.new(Dia::Profiles::NO_OS_SERVICES) do
|
5
|
-
sleep(100)
|
6
|
-
end
|
7
|
-
|
8
|
-
sandbox.run
|
9
|
-
sandbox.terminate
|
10
|
-
sleep(1) # Allow the process time to die ..
|
11
|
-
|
12
|
-
begin
|
13
|
-
Process.kill('SIGKILL', sandbox.pid)
|
14
|
-
false
|
15
|
-
rescue Errno::ESRCH => e
|
16
|
-
true
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
assert("nil will be returned if Dia::Sandbox#run hasn't been called before a call to #terminate") do
|
22
|
-
sandbox = Dia::Sandbox.new(Dia::Profiles::NO_INTERNET) do
|
23
|
-
# ...
|
24
|
-
end
|
25
|
-
|
26
|
-
equal(nil, sandbox.terminate)
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|