tf 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -0
- data/lib/plugins/tf/comment_test_input.rb +5 -2
- data/lib/tf.rb +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -32,6 +32,11 @@ The test can be negated by replacing `=` with `!=`
|
|
32
32
|
- match=/<regexp>/ - regexp match command output
|
33
33
|
- env[<var_name>]=/<regexp>/ - regexp match the given environment variable name
|
34
34
|
|
35
|
+
### Selecting shell / runner program
|
36
|
+
|
37
|
+
From version 0.3.1 Shebang lines are read and interpreted to select the runner shell.
|
38
|
+
Still only Bash / ZSH like shells are allowed.
|
39
|
+
|
35
40
|
## Example
|
36
41
|
|
37
42
|
$ bin/tf example_tests/comment/*
|
@@ -12,7 +12,10 @@ class TF::CommentTestInput
|
|
12
12
|
|
13
13
|
def load file_name
|
14
14
|
lines = []
|
15
|
-
File.readlines(file_name)
|
15
|
+
file_lines = File.readlines(file_name)
|
16
|
+
shell = "bash"
|
17
|
+
shell = file_lines.shift.sub(/^#!/,'') if file_lines[0] =~ /^#!/
|
18
|
+
file_lines.each{|line|
|
16
19
|
# Fix jruby-1.6.6-d19 bug with empty strings from files
|
17
20
|
line = "#{line}"
|
18
21
|
# remove human comments
|
@@ -35,6 +38,6 @@ class TF::CommentTestInput
|
|
35
38
|
end
|
36
39
|
}
|
37
40
|
name = file_name.gsub(/^.*\//,'').sub(/_comment_test\.sh$/,'')
|
38
|
-
{ :name => name, :commands => lines }
|
41
|
+
{ :name => name, :commands => lines, :shell => shell }
|
39
42
|
end
|
40
43
|
end
|
data/lib/tf.rb
CHANGED
@@ -46,8 +46,8 @@ class TF
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def process_test test
|
49
|
-
name, commands = test[:name], test[:commands]
|
50
|
-
shell = Session::
|
49
|
+
name, commands, execution_shell = test[:name], test[:commands], test[:shell]
|
50
|
+
shell = Session::Sh.new(:prog => execution_shell)
|
51
51
|
_env = env(shell)
|
52
52
|
@plugins.output_plugins(:start_test, test, _env)
|
53
53
|
commands.each do |line|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: session
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '3.
|
21
|
+
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '3.
|
29
|
+
version: '3.1'
|
30
30
|
description: Testing Framework solely based on plugins. For now only tests using Bash.
|
31
31
|
email: mpapis+tf@gmail.com
|
32
32
|
executables:
|