hypercuke 0.4.1 → 0.5.0

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: 2df7dbaea6ea4f5665a5f0e698e677f27fa3d9fd
4
- data.tar.gz: 1334aa38a72f29866cff7c844808b59454809a00
3
+ metadata.gz: e4fc2de2d9d06dbc60cbc06eaf8e44cb624170dc
4
+ data.tar.gz: 5182b28d65f9ac1e584ca20a994b7a3dd75a92f4
5
5
  SHA512:
6
- metadata.gz: 8e8ac55bd1d0e6773d148aa7e949904a1c90b171ce6b01e26e48dc40969386b46e317a69fc8ea2f5fe0922304576884ce99dd9ef334fcc289b2edddf2e8c0111
7
- data.tar.gz: ee444352aaef8664bd45206b3485c60402cbb31754033446d8f9526805b1e1d9597952383c7267ef4b5a4feb450ee9fed452542ee76c4ed2308b32f7f1afa7f2
6
+ metadata.gz: e89acf6fd6fbbd1519491b92dc9bc077254c79c16aea0efb4def0288a8e0927a019ae5e3b2f75fc46d65362d96cc501f43b831c4161140bc0c4df02d25d8f4db
7
+ data.tar.gz: 9caab6bdaad88e2f92790c4c3b5f14734548f17a0d3a90a2a6ad88d7f1124eca8fac988ff8facde00c2f7f2d11227f4f5fb3d01e079c894d55241284fc64c680
@@ -35,9 +35,10 @@ module Hypercuke
35
35
  end
36
36
 
37
37
  def layer_tag_for_mode
38
- layer = options[:layer_name]
39
- mode = options[:mode] || 'ok'
40
- '@%s_%s' % [ layer, mode ]
38
+ layer = options.fetch(:layer_name)
39
+ mode = options[:mode]
40
+ blank_or_ok = ->(e) { e.to_s =~ /^(\s*|ok)$/ }
41
+ '@' + [ layer, mode ].reject(&blank_or_ok).join('_')
41
42
  end
42
43
 
43
44
  def add_profile_unless_already_present
@@ -1,3 +1,3 @@
1
1
  module Hypercuke
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -6,20 +6,20 @@ require 'spec_helper'
6
6
  (Assume that the --require business is handled in cucumber.yml.)
7
7
 
8
8
  Some sample HCu commands and their expected outputs:
9
- $ hcu core # cucumber --tags @core_ok
10
- $ hcu model # cucumber --tags @model_ok
9
+ $ hcu core # cucumber --tags @core
10
+ $ hcu model # cucumber --tags @model
11
11
  $ hcu core wip # cucumber --tags @model_wip --profile wip
12
- $ hcu core ok # cucumber --tags @core_ok
12
+ $ hcu core ok # cucumber --tags @core
13
13
 
14
14
  If the user specifies a --profile tag, assume they know what they're doing...
15
- $ hcu core --profile emperor_penguin # cucumber --tags @core_ok --profile emperor_penguin
15
+ $ hcu core --profile emperor_penguin # cucumber --tags @core --profile emperor_penguin
16
16
  $ hcu core wip --profile emperor_penguin # cucumber --tags @core_wip --profile emperor_penguin
17
17
  ...even if they use the "-p" tag instead...
18
- $ hcu core -p emperor_penguin # cucumber --tags @core_ok --profile emperor_penguin
18
+ $ hcu core -p emperor_penguin # cucumber --tags @core --profile emperor_penguin
19
19
  $ hcu core wip -p emperor_penguin # cucumber --tags @core_wip --profile emperor_penguin
20
20
 
21
21
  Everything else should just get passed through to Cucumber unmangled.
22
- $ hcu core --wibble # cucumber --tags @core_ok --wibble
22
+ $ hcu core --wibble # cucumber --tags @core --wibble
23
23
 
24
24
  Also, the '-h' flag should display HCu help (TBD)
25
25
  ( TODO: WRITE THIS EXAMPLE? )
@@ -48,13 +48,13 @@ expected: #{expected_output.inspect}
48
48
  end
49
49
 
50
50
  it "ignores the 0th 'hcu' argument in its various forms (does this even happen?)" do
51
- expect_command_line 'hcu core', "#{cmd_base} --tags @core_ok"
52
- expect_command_line 'bin/hcu core', "#{cmd_base} --tags @core_ok"
51
+ expect_command_line 'hcu core', "#{cmd_base} --tags @core"
52
+ expect_command_line 'bin/hcu core', "#{cmd_base} --tags @core"
53
53
  end
54
54
 
55
55
  it "treats the first argument as a layer name and adds the appropriate --tags flag" do
56
- expect_command_line 'core', "#{cmd_base} --tags @core_ok"
57
- expect_command_line 'model', "#{cmd_base} --tags @model_ok"
56
+ expect_command_line 'core', "#{cmd_base} --tags @core"
57
+ expect_command_line 'model', "#{cmd_base} --tags @model"
58
58
  end
59
59
 
60
60
  it "barfs if the layer name is not given" do
@@ -63,7 +63,7 @@ expected: #{expected_output.inspect}
63
63
  end
64
64
 
65
65
  it "treats the second argument as a mode (assuming it doesn't start with a dash)" do
66
- expect_command_line 'core ok', "#{cmd_base} --tags @core_ok"
66
+ expect_command_line 'core ok', "#{cmd_base} --tags @core"
67
67
  end
68
68
 
69
69
  it "adds '--profile wip' when the mode is 'wip'" do
@@ -71,13 +71,13 @@ expected: #{expected_output.inspect}
71
71
  end
72
72
 
73
73
  it "ignores most other arguments and just hands them off to Cucumber" do
74
- expect_command_line 'core --wibble', "#{cmd_base} --tags @core_ok --wibble"
75
- expect_command_line 'core ok --wibble', "#{cmd_base} --tags @core_ok --wibble"
74
+ expect_command_line 'core --wibble', "#{cmd_base} --tags @core --wibble"
75
+ expect_command_line 'core ok --wibble', "#{cmd_base} --tags @core --wibble"
76
76
  end
77
77
 
78
78
  it "doesn't override a profile if the user explicitly specifies one (using either -p or --profile)" do
79
- expect_command_line 'core --dingbat --profile emperor_penguin', "#{cmd_base} --tags @core_ok --profile emperor_penguin --dingbat"
80
- expect_command_line 'core --dingbat -p emperor_penguin', "#{cmd_base} --tags @core_ok --profile emperor_penguin --dingbat"
79
+ expect_command_line 'core --dingbat --profile emperor_penguin', "#{cmd_base} --tags @core --profile emperor_penguin --dingbat"
80
+ expect_command_line 'core --dingbat -p emperor_penguin', "#{cmd_base} --tags @core --profile emperor_penguin --dingbat"
81
81
  end
82
82
 
83
83
  it "doesn't override a user-specified profile, even in wip mode when it would normally use the wip profile" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hypercuke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Livingston-Gray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-08 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement