wrapp 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/features/step_definitions/wrapp_steps.rb +5 -0
- data/features/wrap_app.feature +4 -0
- data/lib/wrapp/cli.rb +7 -1
- data/lib/wrapp/version.rb +1 -1
- data/spec/wrapp/cli_spec.rb +30 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -70,3 +70,8 @@ Then(/^the App should be wrapped including the parent directory$/) do
|
|
70
70
|
attached_app_path = File.join(volumes_dir, @app.prefix)
|
71
71
|
check_directory_presence([attached_app_path], true)
|
72
72
|
end
|
73
|
+
|
74
|
+
Then(/^I should see usage instructions$/) do
|
75
|
+
expected = "Usage: wrapp [options] APP_PATH"
|
76
|
+
assert_partial_output(expected, all_output)
|
77
|
+
end
|
data/features/wrap_app.feature
CHANGED
data/lib/wrapp/cli.rb
CHANGED
@@ -18,7 +18,13 @@ module Wrapp
|
|
18
18
|
|
19
19
|
def run(argv)
|
20
20
|
app_path = parse_options(argv).first
|
21
|
-
|
21
|
+
if app_path
|
22
|
+
wrapp(app_path, config)
|
23
|
+
else
|
24
|
+
warn 'ERROR: App path is missing!'
|
25
|
+
puts opt_parser
|
26
|
+
exit 2
|
27
|
+
end
|
22
28
|
end
|
23
29
|
|
24
30
|
def wrapp(*opts)
|
data/lib/wrapp/version.rb
CHANGED
data/spec/wrapp/cli_spec.rb
CHANGED
@@ -5,12 +5,42 @@ module Wrapp
|
|
5
5
|
let(:cli) { CLI.new }
|
6
6
|
let(:app_path) { '/Applications/Chunky Bacon.app' }
|
7
7
|
|
8
|
+
it 'include usage instructions in the banner' do
|
9
|
+
expect(CLI.banner).to match(/^usage: \w+ \[options\] \w+$/i)
|
10
|
+
end
|
11
|
+
|
8
12
|
describe '.run' do
|
9
13
|
it 'runs an instance with ARGV' do
|
10
14
|
cli.should_receive(:run).with(ARGV)
|
11
15
|
CLI.stub(:new).and_return(cli)
|
12
16
|
CLI.run
|
13
17
|
end
|
18
|
+
|
19
|
+
context 'without arguments' do
|
20
|
+
let(:argv) { [] }
|
21
|
+
|
22
|
+
before do
|
23
|
+
cli.stub(:warn)
|
24
|
+
cli.stub(:puts)
|
25
|
+
cli.stub(:exit)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'exits non-zero' do
|
29
|
+
cli.should_receive(:exit).with(2)
|
30
|
+
cli.run(argv)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'displays usage on stdout' do
|
34
|
+
cli.should_receive(:opt_parser).and_return('usage')
|
35
|
+
cli.should_receive(:puts).with('usage')
|
36
|
+
cli.run(argv)
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'displays what is missing on stderr' do
|
40
|
+
cli.should_receive(:warn).with('ERROR: App path is missing!')
|
41
|
+
cli.run(argv)
|
42
|
+
end
|
43
|
+
end
|
14
44
|
end
|
15
45
|
|
16
46
|
describe '#run' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: '0'
|
184
184
|
segments:
|
185
185
|
- 0
|
186
|
-
hash:
|
186
|
+
hash: 490571108544621046
|
187
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
188
|
none: false
|
189
189
|
requirements:
|
@@ -192,13 +192,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
segments:
|
194
194
|
- 0
|
195
|
-
hash:
|
195
|
+
hash: 490571108544621046
|
196
196
|
requirements: []
|
197
197
|
rubyforge_project:
|
198
198
|
rubygems_version: 1.8.23
|
199
199
|
signing_key:
|
200
200
|
specification_version: 3
|
201
|
-
summary: wrapp-0.2.
|
201
|
+
summary: wrapp-0.2.2
|
202
202
|
test_files:
|
203
203
|
- features/step_definitions/wrapp_steps.rb
|
204
204
|
- features/support/app.rb
|