hq-dev 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6a564c6509f17e61b34ec035e526a4ee5b98141
4
- data.tar.gz: 0571f085434341f02b52dd773fe0774416c46f26
3
+ metadata.gz: ff226dc93a811a3fa518fdb031ac700597fdc985
4
+ data.tar.gz: d0124d516b6bf17b83f5ca0248c9f75cf2e84ce6
5
5
  SHA512:
6
- metadata.gz: 54861def6e4636a4451f9cf67a6976c2428bcc101d35354ef8202cd2b837af164286efabf7021a2aa24ce782781faf1e6fbd4cf07720fdaee93aac387445a6e8
7
- data.tar.gz: 4f2e317ba323a41ab5a9d9f38c22fcc558f781074b80ec299bc2ebeb9fce65786226c5bd9c00cbdbec8a968dbb921191c491787135213c0695827462258f4210
6
+ metadata.gz: f98902c980d702302ecee42a9e408abc8afa9aec2a1c1315d6c0c6d23092442763be2ede464fb7062382035c5e28b148306d29edb05114413ad78d33c023001c
7
+ data.tar.gz: 4b66e63cf2c61012f23a8dbedfcf47621fe802e35e4b55368866594d8cc9265ca1b53951e7374ee776bad610dc4ae69cdcc449bce7508c666779564ce77b22ed
data/bin/hq-dev-release CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require "fileutils"
4
+
3
5
  project = File.basename(Dir.pwd)
4
6
  ver = ARGV[0]
5
7
 
@@ -54,6 +56,12 @@ puts "pushing to rubygems"
54
56
  shell "gem build #{project}.gemspec"
55
57
  shell "gem push #{project}-#{ver}.gem"
56
58
 
59
+ if project == "hq-dev"
60
+ puts ""
61
+ puts "installing gem"
62
+ shell "gem install hq-dev -v #{ver}"
63
+ end
64
+
57
65
  puts ""
58
66
  puts "done!"
59
67
  puts ""
data/data/gem-versions CHANGED
@@ -1,7 +1,7 @@
1
1
  bson_ext 1.8.5
2
2
  capybara 2.0.2
3
3
  cucumber 1.3.1
4
- hq-dev 0.0.11
4
+ hq-dev 0.0.12
5
5
  hq-engine 0.0.3
6
6
  hq-tools 0.8.0
7
7
  hq-web 0.0.2
@@ -0,0 +1,58 @@
1
+ Feature: Command invocation
2
+
3
+ Background:
4
+
5
+ Given a file "features/support/env.rb":
6
+ """
7
+ require "hq/cucumber/command"
8
+ require "hq/cucumber/temp-dir"
9
+ class CommandScript
10
+ attr_accessor :args, :status, :stdout, :stderr
11
+ def main
12
+ @args.should == [ "arg1", "arg2" ]
13
+ @stdout.puts "standard output"
14
+ @stderr.puts "standard error"
15
+ @status = 123
16
+ end
17
+ end
18
+ $commands["command"] = CommandScript
19
+ """
20
+
21
+ Scenario: Invoke a script and check the output
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":
31
+ """
32
+ Feature:
33
+ Scenario: Invoke script
34
+ Given a file "args":
35
+ \"\"\"
36
+ arg1
37
+ arg2
38
+ \"\"\"
39
+ When I invoke command with "args"
40
+ Then the command stdout should be:
41
+ \"\"\"
42
+ standard output
43
+ \"\"\"
44
+ And the command stderr should be:
45
+ \"\"\"
46
+ standard error
47
+ \"\"\"
48
+ And the command exit status should be 123
49
+ """
50
+
51
+ When I run "cucumber"
52
+
53
+ Then the output should contain:
54
+ """
55
+ 1 scenario (1 passed)
56
+ 5 steps (5 passed)
57
+ """
58
+ And the exit status should be 0
@@ -0,0 +1,47 @@
1
+ require "shellwords"
2
+
3
+ $commands = {}
4
+
5
+ When /^I invoke (\S+) with "([^"]+)"$/ do
6
+ |command_name, args_name|
7
+
8
+ command_class = $commands[command_name]
9
+
10
+ script = command_class.new
11
+
12
+ script.args = Shellwords.split File.read(args_name)
13
+
14
+ script.stdout = StringIO.new
15
+ script.stderr = StringIO.new
16
+
17
+ script.main
18
+
19
+ @command_exit_status = script.status
20
+ @command_stdout = script.stdout.string
21
+ @command_stderr = script.stderr.string
22
+
23
+ end
24
+
25
+ Then /^the command stdout should be:$/ do
26
+ |stdout_expect|
27
+
28
+ @command_stdout.strip.should == stdout_expect.strip
29
+
30
+ end
31
+
32
+ Then /^the command stderr should be:$/ do
33
+ |stderr_expect|
34
+
35
+ @command_stderr.strip.should == stderr_expect.strip
36
+
37
+ end
38
+
39
+ Then /^the command exit status should be (\d+)$/ do
40
+ |exit_status_expect_str|
41
+
42
+ exit_status_expect = exit_status_expect_str.to_i
43
+
44
+ @command_exit_status.should == exit_status_expect
45
+
46
+ end
47
+
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.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pharaoh
@@ -105,6 +105,7 @@ extra_rdoc_files: []
105
105
  files:
106
106
  - lib/hq/cucumber/temp-dir.rb
107
107
  - lib/hq/cucumber/time.rb
108
+ - lib/hq/cucumber/command.rb
108
109
  - data/gem-versions
109
110
  - defaults/test-files
110
111
  - defaults/development-dependencies
@@ -114,6 +115,7 @@ files:
114
115
  - templates/gemspec
115
116
  - templates/travis
116
117
  - templates/gemfile
118
+ - features/command.feature
117
119
  - features/temp-dir.feature
118
120
  - features/time.feature
119
121
  - features/support/steps.rb
@@ -144,6 +146,7 @@ signing_key:
144
146
  specification_version: 4
145
147
  summary: HQ dev
146
148
  test_files:
149
+ - features/command.feature
147
150
  - features/temp-dir.feature
148
151
  - features/time.feature
149
152
  - features/support/steps.rb