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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81522f7e806fe81f04d37a688fe8379914b03ce4
4
- data.tar.gz: 712a2af09d2dd6cf64f36257f32ed9ac0bf2734f
3
+ metadata.gz: c904b6d073280b27d7a3516c46f073b338e88b5f
4
+ data.tar.gz: 03b46167be66ab247f7e163f3bc79cbccfa21414
5
5
  SHA512:
6
- metadata.gz: 5f3f0d0c3eb69db6e059f1eb0d52d49a395aee1fb8fba8bd53e34a3ccdf074aa37851c93b95d92e9345399238c1fbd7dd06280c9c78ae26ab2f3c5c04c6706bf
7
- data.tar.gz: 53a84bcc0059b0fb5a331ac5d5942f240d6ea946e9fc707deb3388aed700ba369f655371f207dc072817543d2db9bd47267bf93e7775a9cb5fa07ec07019922d
6
+ metadata.gz: bc64eba1db78bdf29e7810e1a1537ed17697cfe4a0d37c28507f4a719fd23f4d1a06b7830264e0c6484b0c91465c52e31be5d8f3ede8874cf8c1d511156ece0b
7
+ data.tar.gz: 80a094a0b0eeca53f8d4e584f12e3ddaf8740ac4f10de566b6d2a12f99d6326e47245917b092f73fcd1ac039e92da6524d62bfa38d77a91e0c42522b08264893
data/README.md CHANGED
@@ -28,7 +28,7 @@ Add the gem to your `Gemfile`:
28
28
  ```ruby
29
29
  # Gemfile
30
30
 
31
- gem 'dredd-rack', '~> 0.6.0' # see semver.org
31
+ gem 'dredd-rack', '~> 0.7.0' # see semver.org
32
32
  ```
33
33
 
34
34
  Define which application Dredd::Rack must serve automatically:
data/lib/dredd/rack.rb CHANGED
@@ -2,6 +2,7 @@ require 'dredd/rack/configuration'
2
2
  require 'dredd/rack/rake_task'
3
3
  require 'dredd/rack/runner'
4
4
  require 'dredd/rack/version'
5
+ require 'dredd/rack/errors'
5
6
 
6
7
  module Dredd
7
8
  module Rack
@@ -0,0 +1,10 @@
1
+ module Dredd
2
+ module Rack
3
+ class InvalidCommandError < Class.new(RuntimeError)
4
+
5
+ def initialize(command)
6
+ super("Invalid command - #{command}")
7
+ end
8
+ end
9
+ end
10
+ end
@@ -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
- if command_valid?
97
- start_server! unless api_remote?
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
@@ -1,5 +1,5 @@
1
1
  module Dredd
2
2
  module Rack
3
- VERSION = '0.6.0'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
@@ -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.6.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-07-24 00:00:00.000000000 Z
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.7
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: