heisenberg 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +18 -0
- data/heisenberg.gemspec +2 -0
- data/lib/heisenberg/matchers.rb +26 -0
- data/lib/heisenberg/version.rb +1 -1
- data/lib/heisenberg.rb +1 -13
- metadata +21 -3
data/Gemfile.lock
ADDED
data/heisenberg.gemspec
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
http_statuses = {
|
2
|
+
successful: 200,
|
3
|
+
created: 201,
|
4
|
+
no_content: 204,
|
5
|
+
bad_request: 400,
|
6
|
+
unauthorized: 401,
|
7
|
+
forbidden: 403,
|
8
|
+
not_found: 404,
|
9
|
+
server_error: 500,
|
10
|
+
}
|
11
|
+
|
12
|
+
for status, code in http_statuses
|
13
|
+
eval <<-EOS
|
14
|
+
RSpec::Matchers.define "be_#{status}" do
|
15
|
+
|
16
|
+
match do |actual|
|
17
|
+
actual.to_s == "#{code}"
|
18
|
+
end
|
19
|
+
|
20
|
+
failure_message_for_should do |actual|
|
21
|
+
"Expected " + http_statuses.key(actual).to_s + " to be #{status.to_s}"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
EOS
|
26
|
+
end
|
data/lib/heisenberg/version.rb
CHANGED
data/lib/heisenberg.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require "rack/test"
|
2
|
-
|
3
2
|
require "heisenberg/hashext"
|
4
3
|
require "heisenberg/version"
|
5
4
|
require "heisenberg/api_integration_spec"
|
@@ -12,17 +11,6 @@ module Heisenberg
|
|
12
11
|
type: :rest_api
|
13
12
|
end
|
14
13
|
|
15
|
-
|
16
|
-
match do |actual|
|
17
|
-
actual == case expected
|
18
|
-
when :success then 200
|
19
|
-
when :created then 201
|
20
|
-
when :no_content then 204
|
21
|
-
when :bad_request then 400
|
22
|
-
when :unauthorized then 401
|
23
|
-
when :forbidden then 403
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
14
|
+
require "heisenberg/matchers"
|
27
15
|
end
|
28
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heisenberg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
13
|
-
dependencies:
|
12
|
+
date: 2012-12-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rack-test
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.6.2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.6.2
|
14
30
|
description: Heisenberg is an REST API integration testing tool for rack based REST
|
15
31
|
APIs
|
16
32
|
email:
|
@@ -21,6 +37,7 @@ extra_rdoc_files: []
|
|
21
37
|
files:
|
22
38
|
- .gitignore
|
23
39
|
- Gemfile
|
40
|
+
- Gemfile.lock
|
24
41
|
- LICENSE
|
25
42
|
- README.md
|
26
43
|
- Rakefile
|
@@ -28,6 +45,7 @@ files:
|
|
28
45
|
- lib/heisenberg.rb
|
29
46
|
- lib/heisenberg/api_integration_spec.rb
|
30
47
|
- lib/heisenberg/hashext.rb
|
48
|
+
- lib/heisenberg/matchers.rb
|
31
49
|
- lib/heisenberg/version.rb
|
32
50
|
homepage: https://github.com/marcelloma/heisenberg
|
33
51
|
licenses: []
|