hq-dev 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66e1457081de3b296cbb878938de4aad3a714571
4
- data.tar.gz: 8653755b20cec83daa6de9f75bd3834e5bad0533
3
+ metadata.gz: 01f16e12ae07fafe4611531e4166a24e8dca6081
4
+ data.tar.gz: b28bb86247c3e29aab501bb883dbdac35e42289e
5
5
  SHA512:
6
- metadata.gz: 9404bd5dd667cc00ebcc8a43b2df706ca84247e7fceed9df64bcf2ebd90db729bbc625b46e0cd3abaf7490f6148b2e6942ce020fa4c090925de9851f5a10642b
7
- data.tar.gz: 8aefdb18cda8278420178647d0665808102647131c03bb5604edfe691b69e87397d3353accdb905e6fd3c9d401fc131b69c4a6fefda7e9df891d2b6aed20f499
6
+ metadata.gz: 1794edc9d59561e48ae34c832d7e93df6365af2598efeecc186177769ed723e449ffad810c4ffc927e8aedd429b6332825dc13955daa3250619caeebfe6eeb03
7
+ data.tar.gz: a66f1a5586cb20889d153f9c725de915c01236ed91b4006e131b5889210d47cceb2abc732e73bd92bac52fdc9e92e3990b742d115e14afcb29916313d11d873e
data/data/gem-versions CHANGED
@@ -2,7 +2,7 @@ aws-sdk 1.9.5
2
2
  bson_ext 1.8.5
3
3
  capybara 2.0.2
4
4
  cucumber 1.3.1
5
- hq-dev 0.0.14
5
+ hq-dev 0.0.15
6
6
  hq-engine 0.0.3
7
7
  hq-tools 0.8.0
8
8
  hq-web 0.0.2
@@ -18,16 +18,9 @@ Feature: Command invocation
18
18
  $commands["command"] = CommandScript
19
19
  """
20
20
 
21
- Scenario: Invoke a script and check the output
21
+ Scenario: Invoke a script with an args file
22
22
 
23
- Given a file "features/support/steps.rb":
24
- """
25
- Then /^the file is created correctly$/ do
26
- File.read("abc.def").should == "Hello world"
27
- end
28
- """
29
-
30
- And a file "features/test.feature":
23
+ Given a file "features/test.feature":
31
24
  """
32
25
  Feature:
33
26
  Scenario: Invoke script
@@ -56,3 +49,36 @@ Feature: Command invocation
56
49
  5 steps (5 passed)
57
50
  """
58
51
  And the exit status should be 0
52
+
53
+ Scenario: Execute a shell command
54
+
55
+ Given a file "features/test.feature":
56
+ """
57
+ Feature:
58
+ Scenario: Run script
59
+ Given a file "command":
60
+ \"\"\"
61
+ echo hello standard output
62
+ echo hello standard error >&2
63
+ exit 123
64
+ \"\"\"
65
+ When I run "bash command"
66
+ Then the command stdout should be:
67
+ \"\"\"
68
+ hello standard output
69
+ \"\"\"
70
+ And the command stderr should be:
71
+ \"\"\"
72
+ hello standard error
73
+ \"\"\"
74
+ And the command exit status should be 123
75
+ """
76
+
77
+ When I run "cucumber"
78
+
79
+ Then the output should contain:
80
+ """
81
+ 1 scenario (1 passed)
82
+ 5 steps (5 passed)
83
+ """
84
+ And the exit status should be 0
@@ -1,4 +1,5 @@
1
1
  require "shellwords"
2
+ require "tempfile"
2
3
 
3
4
  $commands = {}
4
5
 
@@ -22,6 +23,34 @@ When /^I invoke (\S+) with "([^"]+)"$/ do
22
23
 
23
24
  end
24
25
 
26
+ When /^I run "([^"]+)"$/ do
27
+ |command_str|
28
+
29
+ stdout_temp =
30
+ Tempfile.new "cuke-command-stdout-"
31
+
32
+ stderr_temp =
33
+ Tempfile.new "cuke-command-stderr-"
34
+
35
+ system "(%s) >%s 2>%s" % [
36
+ command_str,
37
+ stdout_temp.path,
38
+ stderr_temp.path,
39
+ ]
40
+
41
+ @command_exit_status = $?.exitstatus
42
+
43
+ @command_stdout =
44
+ File.read stdout_temp.path
45
+
46
+ @command_stderr =
47
+ File.read stderr_temp.path
48
+
49
+ stdout_temp.unlink
50
+ stderr_temp.unlink
51
+
52
+ end
53
+
25
54
  Then /^the command stdout should be:$/ do
26
55
  |stdout_expect|
27
56
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hq-dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pharaoh