dredd-rack 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/dredd/rack.rb +1 -0
- data/lib/dredd/rack/errors.rb +10 -0
- data/lib/dredd/rack/runner.rb +3 -5
- data/lib/dredd/rack/version.rb +1 -1
- data/spec/lib/dredd/rack/runner_spec.rb +13 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c904b6d073280b27d7a3516c46f073b338e88b5f
|
4
|
+
data.tar.gz: 03b46167be66ab247f7e163f3bc79cbccfa21414
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc64eba1db78bdf29e7810e1a1537ed17697cfe4a0d37c28507f4a719fd23f4d1a06b7830264e0c6484b0c91465c52e31be5d8f3ede8874cf8c1d511156ece0b
|
7
|
+
data.tar.gz: 80a094a0b0eeca53f8d4e584f12e3ddaf8740ac4f10de566b6d2a12f99d6326e47245917b092f73fcd1ac039e92da6524d62bfa38d77a91e0c42522b08264893
|
data/README.md
CHANGED
data/lib/dredd/rack.rb
CHANGED
data/lib/dredd/rack/runner.rb
CHANGED
@@ -92,11 +92,9 @@ module Dredd
|
|
92
92
|
#
|
93
93
|
# Returns true if the Dredd exit status is zero, false instead.
|
94
94
|
def run
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
Kernel.system(command)
|
99
|
-
end
|
95
|
+
raise InvalidCommandError.new(command) unless command_valid?
|
96
|
+
start_server! unless api_remote?
|
97
|
+
Kernel.system(command)
|
100
98
|
end
|
101
99
|
|
102
100
|
# Ensure that the runner does respond_to? its option methods
|
data/lib/dredd/rack/version.rb
CHANGED
@@ -164,6 +164,19 @@ describe Dredd::Rack::Runner do
|
|
164
164
|
|
165
165
|
describe '#run', public: true do
|
166
166
|
|
167
|
+
context 'when the command is not valid' do
|
168
|
+
|
169
|
+
before(:each) do
|
170
|
+
allow(subject).to receive(:command_valid?).and_return(false)
|
171
|
+
end
|
172
|
+
|
173
|
+
it 'raises Dredd::Rack::InvalidCommandError' do
|
174
|
+
command = 'test_command'
|
175
|
+
allow(subject).to receive(:command).and_return(command)
|
176
|
+
expect { subject.run }.to raise_error(Dredd::Rack::InvalidCommandError)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
167
180
|
context 'when the command is valid' do
|
168
181
|
|
169
182
|
before(:each) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dredd-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gonzalo Bulnes Guilpain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- doc/runner.md
|
96
96
|
- lib/dredd/rack.rb
|
97
97
|
- lib/dredd/rack/configuration.rb
|
98
|
+
- lib/dredd/rack/errors.rb
|
98
99
|
- lib/dredd/rack/rake_task.rb
|
99
100
|
- lib/dredd/rack/runner.rb
|
100
101
|
- lib/dredd/rack/version.rb
|
@@ -128,19 +129,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
131
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.4.
|
132
|
+
rubygems_version: 2.4.8
|
132
133
|
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: Convenient API blueprint testing with Apiary Dredd for Rack applications.
|
135
136
|
test_files:
|
136
|
-
- spec/lib/dredd/rack/rake_task_spec.rb
|
137
|
-
- spec/lib/dredd/rack/configuration_spec.rb
|
138
137
|
- spec/lib/dredd/rack/runner_spec.rb
|
138
|
+
- spec/lib/dredd/rack/configuration_spec.rb
|
139
|
+
- spec/lib/dredd/rack/rake_task_spec.rb
|
139
140
|
- spec/lib/dredd/rack_spec.rb
|
140
141
|
- spec/spec_helper.rb
|
141
|
-
- spec/support/specs_for_single_argument_options.rb
|
142
|
-
- spec/support/specs_for_boolean_options.rb
|
143
142
|
- spec/support/specs_for_negatable_boolean_options.rb
|
144
143
|
- spec/support/specs_for_options.rb
|
145
144
|
- spec/support/spec_for_configuration_option_interface.rb
|
145
|
+
- spec/support/specs_for_boolean_options.rb
|
146
|
+
- spec/support/specs_for_single_argument_options.rb
|
146
147
|
has_rdoc:
|