assert-rack-test 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +4 -4
- data/LICENSE.txt +22 -0
- data/README.md +63 -0
- data/Rakefile +0 -1
- data/assert-rack-test.gemspec +14 -11
- data/lib/assert-rack-test.rb +6 -11
- data/lib/assert-rack-test/version.rb +4 -6
- data/log/.gitkeep +0 -0
- data/test/helper.rb +9 -5
- data/test/unit/{assert-rack-test_test.rb → assert-rack-test_tests.rb} +2 -1
- metadata +20 -17
- data/README.markdown +0 -76
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2011-Present Collin Redding and Kelly Redding
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Assert-Rack-Test
|
2
|
+
|
3
|
+
The [assert](https://github.com/teaminsight/assert) gem with [rack/test](https://github.com/brynary/rack-test). This gem just mixes in the Rack::Test methods into the Assert context, allowing you to use Rack::Test's get, post, put, etc... methods within an Assert context.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
Use assert as you normally would. Inherit from a context and use any of rack test's methods in your tests:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
class BaseTest < Asset::Context
|
11
|
+
desc "some test"
|
12
|
+
setup do
|
13
|
+
get '/some/route'
|
14
|
+
end
|
15
|
+
|
16
|
+
should "have returned a successful response" do
|
17
|
+
assert_equal 200, last_response.status
|
18
|
+
assert_equal "Some route indeed!", last_response.body
|
19
|
+
end
|
20
|
+
end
|
21
|
+
```
|
22
|
+
|
23
|
+
You still need to define an app method, like you normally would for rack test:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
# app method for entire test suite
|
27
|
+
Assert::Context.class_eval do
|
28
|
+
def app
|
29
|
+
MyApp.new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# or for one context
|
34
|
+
class BaseTest < Assert::Context
|
35
|
+
|
36
|
+
def app
|
37
|
+
OtherApp.new
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
```
|
42
|
+
|
43
|
+
## Installation
|
44
|
+
|
45
|
+
Add this line to your application's Gemfile:
|
46
|
+
|
47
|
+
gem 'assert-rack-test'
|
48
|
+
|
49
|
+
And then execute:
|
50
|
+
|
51
|
+
$ bundle
|
52
|
+
|
53
|
+
Or install it yourself as:
|
54
|
+
|
55
|
+
$ gem install assert-rack-test
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
1. Fork it
|
60
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
61
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
62
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
63
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
data/assert-rack-test.gemspec
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "assert-rack-test/version"
|
3
5
|
|
4
6
|
Gem::Specification.new do |gem|
|
5
|
-
gem.
|
6
|
-
gem.
|
7
|
+
gem.name = "assert-rack-test"
|
8
|
+
gem.version = Assert::Rack::Test::VERSION
|
9
|
+
gem.authors = ["Collin Redding", "Kelly Redding"]
|
10
|
+
gem.email = ["collin.redding@me.com, kelly@kellyredding.com"]
|
7
11
|
gem.description = %q{Assert with Rack::Test}
|
8
12
|
gem.summary = %q{Assert with Rack::Test}
|
9
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "https://github.com/redding/assert-rack-test"
|
10
14
|
|
11
|
-
gem.
|
12
|
-
gem.
|
13
|
-
gem.test_files =
|
14
|
-
gem.name = "assert-rack-test"
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
15
18
|
gem.require_paths = ["lib"]
|
16
|
-
gem.version = Assert::Rack::Test::VERSION
|
17
19
|
|
18
|
-
gem.add_dependency("assert",
|
19
|
-
gem.add_dependency("rack-test",
|
20
|
+
gem.add_dependency("assert", ["~> 2.0"])
|
21
|
+
gem.add_dependency("rack-test", ["~> 0.6"])
|
22
|
+
|
20
23
|
end
|
21
24
|
|
data/lib/assert-rack-test.rb
CHANGED
@@ -1,20 +1,15 @@
|
|
1
|
-
require 'assert'
|
1
|
+
require 'assert/context'
|
2
2
|
require 'rack/test'
|
3
|
-
|
4
3
|
require 'assert-rack-test/version'
|
5
4
|
|
6
|
-
module Assert
|
7
|
-
module Rack
|
8
|
-
module Test
|
9
|
-
|
10
|
-
def self.included(klass)
|
11
|
-
klass.class_eval do
|
12
|
-
include ::Rack::Test::Methods
|
13
|
-
end
|
14
|
-
end
|
5
|
+
module Assert::Rack::Test
|
15
6
|
|
7
|
+
def self.included(klass)
|
8
|
+
klass.class_eval do
|
9
|
+
include ::Rack::Test::Methods
|
16
10
|
end
|
17
11
|
end
|
12
|
+
|
18
13
|
end
|
19
14
|
|
20
15
|
Assert::Context.class_eval do
|
data/log/.gitkeep
ADDED
File without changes
|
data/test/helper.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# this file is automatically required when you run `assert`
|
2
|
+
# put any test helpers here
|
3
|
+
|
4
|
+
# add the root dir to the load path
|
5
|
+
$LOAD_PATH.unshift(File.expand_path("../..", __FILE__))
|
6
|
+
|
7
|
+
# require pry for debugging (`binding.pry`)
|
8
|
+
require 'pry'
|
9
|
+
|
metadata
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert-rack-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
- Kelly Redding
|
14
13
|
- Collin Redding
|
14
|
+
- Kelly Redding
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-03-
|
19
|
+
date: 2013-03-28 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
+
name: assert
|
22
23
|
prerelease: false
|
23
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
26
27
|
- - ~>
|
@@ -30,12 +31,12 @@ dependencies:
|
|
30
31
|
- 2
|
31
32
|
- 0
|
32
33
|
version: "2.0"
|
33
|
-
requirement: *id001
|
34
|
-
name: assert
|
35
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
+
name: rack-test
|
37
38
|
prerelease: false
|
38
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
41
|
requirements:
|
41
42
|
- - ~>
|
@@ -45,12 +46,11 @@ dependencies:
|
|
45
46
|
- 0
|
46
47
|
- 6
|
47
48
|
version: "0.6"
|
48
|
-
requirement: *id002
|
49
|
-
name: rack-test
|
50
49
|
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
51
|
description: Assert with Rack::Test
|
52
52
|
email:
|
53
|
-
- collin.redding@me.com
|
53
|
+
- collin.redding@me.com, kelly@kellyredding.com
|
54
54
|
executables: []
|
55
55
|
|
56
56
|
extensions: []
|
@@ -60,14 +60,17 @@ extra_rdoc_files: []
|
|
60
60
|
files:
|
61
61
|
- .gitignore
|
62
62
|
- Gemfile
|
63
|
-
-
|
63
|
+
- LICENSE.txt
|
64
|
+
- README.md
|
64
65
|
- Rakefile
|
65
66
|
- assert-rack-test.gemspec
|
66
67
|
- lib/assert-rack-test.rb
|
67
68
|
- lib/assert-rack-test/version.rb
|
69
|
+
- log/.gitkeep
|
68
70
|
- test/helper.rb
|
69
|
-
- test/unit/assert-rack-
|
70
|
-
|
71
|
+
- test/unit/assert-rack-test_tests.rb
|
72
|
+
- tmp/.gitkeep
|
73
|
+
homepage: https://github.com/redding/assert-rack-test
|
71
74
|
licenses: []
|
72
75
|
|
73
76
|
post_install_message:
|
@@ -96,10 +99,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
99
|
requirements: []
|
97
100
|
|
98
101
|
rubyforge_project:
|
99
|
-
rubygems_version: 1.8.
|
102
|
+
rubygems_version: 1.8.24
|
100
103
|
signing_key:
|
101
104
|
specification_version: 3
|
102
105
|
summary: Assert with Rack::Test
|
103
106
|
test_files:
|
104
107
|
- test/helper.rb
|
105
|
-
- test/unit/assert-rack-
|
108
|
+
- test/unit/assert-rack-test_tests.rb
|
data/README.markdown
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
# Assert-Rack-Test
|
2
|
-
|
3
|
-
The [assert](https://github.com/teaminsight/assert) gem with [rack/test](https://github.com/brynary/rack-test). This gem just mixes in the Rack::Test methods into the Assert context, allowing you to use Rack::Test's get, post, put, etc... methods within an Assert context.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
In your Gemfile add:
|
8
|
-
|
9
|
-
group :test do
|
10
|
-
gem 'assert-rack-test'
|
11
|
-
end
|
12
|
-
|
13
|
-
Then run `bundle install` to install the gem.
|
14
|
-
|
15
|
-
## Usage
|
16
|
-
|
17
|
-
Use assert as you normally would. Inherit from a context and use any of rack test's methods in your tests:
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
class BaseTest < Asset::Context
|
21
|
-
desc "some test"
|
22
|
-
setup do
|
23
|
-
get '/some/route'
|
24
|
-
end
|
25
|
-
|
26
|
-
should "have returned a successful response" do
|
27
|
-
assert_equal 200, last_response.status
|
28
|
-
assert_equal "Some route indeed!", last_response.body
|
29
|
-
end
|
30
|
-
end
|
31
|
-
```
|
32
|
-
|
33
|
-
You still need to define an app method, like you normally would for rack test:
|
34
|
-
|
35
|
-
```ruby
|
36
|
-
# app method for entire test suite
|
37
|
-
Assert::Context.class_eval do
|
38
|
-
def app
|
39
|
-
MyApp.new
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# or for one context
|
44
|
-
class BaseTest < Assert::Context
|
45
|
-
|
46
|
-
def app
|
47
|
-
OtherApp.new
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
```
|
52
|
-
|
53
|
-
## License
|
54
|
-
|
55
|
-
Copyright (c) 2011 Kelly Redding, Collin Redding, and Team Insight
|
56
|
-
|
57
|
-
Permission is hereby granted, free of charge, to any person
|
58
|
-
obtaining a copy of this software and associated documentation
|
59
|
-
files (the "Software"), to deal in the Software without
|
60
|
-
restriction, including without limitation the rights to use,
|
61
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
62
|
-
copies of the Software, and to permit persons to whom the
|
63
|
-
Software is furnished to do so, subject to the following
|
64
|
-
conditions:
|
65
|
-
|
66
|
-
The above copyright notice and this permission notice shall be
|
67
|
-
included in all copies or substantial portions of the Software.
|
68
|
-
|
69
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
70
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
71
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
72
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
73
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
74
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
75
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
76
|
-
OTHER DEALINGS IN THE SOFTWARE.
|