hq-dev 0.0.18 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/gem-versions +1 -1
- data/features/command.feature +3 -0
- data/features/temp-dir.feature +3 -0
- data/features/time.feature +1 -0
- data/lib/hq/cucumber/command.rb +25 -0
- data/lib/hq/cucumber/temp-dir.rb +17 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a9d77651552da19bd0c94597298ae45bc4ba650
|
4
|
+
data.tar.gz: 645620be36f5329bd4a25ffbb17ea44d64ce3ad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddc25d9acdd480202a136f363d4394a0fcff6063b74fd6f74a33e3cf7a52f07abec09fa8258ccafddac7133db84c9e8637b3489785f64874b51bb2b4a80068f6
|
7
|
+
data.tar.gz: 0f7e22eb85eb0267a93ffe7b104e93f28e488bc1045ad02ba351d15c2538ecc60848eb42c949da464929c78a51af5ea51fdb7ceae4760a31cd7ed6e3fe41f87e
|
data/data/gem-versions
CHANGED
data/features/command.feature
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@temp-dir
|
1
2
|
Feature: Command invocation
|
2
3
|
|
3
4
|
Background:
|
@@ -22,6 +23,7 @@ Feature: Command invocation
|
|
22
23
|
|
23
24
|
Given a file "features/test.feature":
|
24
25
|
"""
|
26
|
+
@temp-dir
|
25
27
|
Feature:
|
26
28
|
Scenario: Invoke script
|
27
29
|
Given a file "args":
|
@@ -54,6 +56,7 @@ Feature: Command invocation
|
|
54
56
|
|
55
57
|
Given a file "features/test.feature":
|
56
58
|
"""
|
59
|
+
@temp-dir
|
57
60
|
Feature:
|
58
61
|
Scenario: Run script
|
59
62
|
Given a file "command":
|
data/features/temp-dir.feature
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@temp-dir
|
1
2
|
Feature: Temporary directory and files
|
2
3
|
|
3
4
|
Background:
|
@@ -18,6 +19,7 @@ Feature: Temporary directory and files
|
|
18
19
|
|
19
20
|
And a file "features/test.feature":
|
20
21
|
"""
|
22
|
+
@temp-dir
|
21
23
|
Feature:
|
22
24
|
Scenario: Simple file
|
23
25
|
Given a file "abc.def":
|
@@ -62,6 +64,7 @@ Feature: Temporary directory and files
|
|
62
64
|
|
63
65
|
And a file "features/test.feature":
|
64
66
|
"""
|
67
|
+
@temp-dir
|
65
68
|
Feature:
|
66
69
|
Scenario: Create dir
|
67
70
|
Given a directory "some-dir"
|
data/features/time.feature
CHANGED
data/lib/hq/cucumber/command.rb
CHANGED
@@ -26,6 +26,12 @@ end
|
|
26
26
|
When /^I run "([^"]+)"$/ do
|
27
27
|
|command_str|
|
28
28
|
|
29
|
+
command_run command_str
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def command_run command_str
|
34
|
+
|
29
35
|
stdout_temp =
|
30
36
|
Tempfile.new "cuke-command-stdout-"
|
31
37
|
|
@@ -58,6 +64,13 @@ Then /^the command stdout should be:$/ do
|
|
58
64
|
|
59
65
|
end
|
60
66
|
|
67
|
+
Then /^the command stdout should include:$/ do
|
68
|
+
|stdout_expect|
|
69
|
+
|
70
|
+
@command_stdout.strip.should include stdout_expect.strip
|
71
|
+
|
72
|
+
end
|
73
|
+
|
61
74
|
Then /^the command stderr should be:$/ do
|
62
75
|
|stderr_expect|
|
63
76
|
|
@@ -65,6 +78,13 @@ Then /^the command stderr should be:$/ do
|
|
65
78
|
|
66
79
|
end
|
67
80
|
|
81
|
+
Then /^the command stderr should include:$/ do
|
82
|
+
|stderr_expect|
|
83
|
+
|
84
|
+
@command_stderr.strip.should include stderr_expect.strip
|
85
|
+
|
86
|
+
end
|
87
|
+
|
68
88
|
Then /^the command exit status should be (\d+)$/ do
|
69
89
|
|exit_status_expect_str|
|
70
90
|
|
@@ -74,3 +94,8 @@ Then /^the command exit status should be (\d+)$/ do
|
|
74
94
|
|
75
95
|
end
|
76
96
|
|
97
|
+
Then /^the command exit status should be non-zero$/ do
|
98
|
+
|
99
|
+
@command_exit_status.should_not == 0
|
100
|
+
|
101
|
+
end
|
data/lib/hq/cucumber/temp-dir.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require "fileutils"
|
2
2
|
require "tmpdir"
|
3
3
|
|
4
|
-
Before do
|
4
|
+
Before "@temp-dir" do
|
5
5
|
|
6
|
-
@
|
6
|
+
@project_dir = Dir.pwd
|
7
7
|
@temp_dir = Dir.mktmpdir
|
8
8
|
|
9
9
|
Dir.chdir @temp_dir
|
@@ -12,17 +12,25 @@ Before do
|
|
12
12
|
|
13
13
|
end
|
14
14
|
|
15
|
-
After do
|
15
|
+
After "@temp-dir" do
|
16
16
|
|
17
|
-
|
17
|
+
Dir.chdir @project_dir
|
18
18
|
|
19
|
-
|
19
|
+
if $temp_dir_use_sudo
|
20
|
+
system "sudo rm -rf #{@temp_dir}"
|
21
|
+
else
|
22
|
+
FileUtils.remove_entry_secure @temp_dir
|
23
|
+
end
|
24
|
+
|
25
|
+
@temp_dir = nil
|
20
26
|
|
21
27
|
end
|
22
28
|
|
23
29
|
Given /^a file "(.+)":$/ do
|
24
30
|
|file_name, file_contents|
|
25
31
|
|
32
|
+
raise "Must use @temp-dir tag" unless @temp_dir
|
33
|
+
|
26
34
|
dir_name = File.dirname file_name
|
27
35
|
|
28
36
|
FileUtils.mkdir_p dir_name
|
@@ -53,6 +61,8 @@ end
|
|
53
61
|
Given /^a directory "(.+)"$/ do
|
54
62
|
|dir_name|
|
55
63
|
|
64
|
+
raise "Must use @temp-dir tag" unless @temp_dir
|
65
|
+
|
56
66
|
Dir.mkdir dir_name
|
57
67
|
|
58
68
|
end
|
@@ -60,6 +70,8 @@ end
|
|
60
70
|
Then /^there should be a file "(.+)":$/ do
|
61
71
|
|file_name, file_contents_expect|
|
62
72
|
|
73
|
+
raise "Must use @temp-dir tag" unless @temp_dir
|
74
|
+
|
63
75
|
file_contents_actual =
|
64
76
|
File.read file_name
|
65
77
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hq-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Pharaoh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|