assert-rack-test 1.0.2 → 1.1.1
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.
- checksums.yaml +7 -0
- data/Gemfile +6 -3
- data/LICENSE +22 -0
- data/README.md +63 -0
- data/assert-rack-test.gemspec +23 -15
- data/lib/assert-rack-test.rb +10 -12
- data/lib/assert-rack-test/version.rb +7 -6
- data/log/.gitkeep +0 -0
- data/test/helper.rb +12 -5
- data/test/support/factory.rb +7 -0
- data/test/system/.keep +0 -0
- data/test/unit/assert-rack-test_tests.rb +19 -0
- data/tmp/.gitkeep +0 -0
- metadata +75 -78
- data/.gitignore +0 -17
- data/README.markdown +0 -76
- data/Rakefile +0 -2
- data/test/unit/assert-rack-test_test.rb +0 -20
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 509ed811261329d270722f471c1a07f7804d0018e6417a1bbb71769edc29b2f9
|
4
|
+
data.tar.gz: 4eeca98e3bebab766db468254559d5a511443d3bfa2872e7f298d3a0e5b01490
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 393be9679074814ffff99d3111c22bfa6c60c379126d5d70963122e7f6bf8d5158f01702e3c4991a4882eb5ce8519dfe0f7b1d2582fe6d0e195467ec57f20377
|
7
|
+
data.tar.gz: f7d171e3abd537e54f6c700ed08e8aa5780e6765fee25720fbd1ea001d8bfff131ac1af8216919bb8408fc3d9045f80a39a7c0ca6e2eaad34cc6158adebca458
|
data/Gemfile
CHANGED
data/LICENSE
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/assert-rack-test.gemspec
CHANGED
@@ -1,21 +1,29 @@
|
|
1
|
-
#
|
2
|
-
require File.expand_path('../lib/assert-rack-test/version', __FILE__)
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
gem.description = %q{Assert with Rack::Test}
|
8
|
-
gem.summary = %q{Assert with Rack::Test}
|
9
|
-
gem.homepage = ""
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "assert-rack-test/version"
|
10
6
|
|
11
|
-
|
12
|
-
gem.files = `git ls-files`.split("\n")
|
13
|
-
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
7
|
+
Gem::Specification.new do |gem|
|
14
8
|
gem.name = "assert-rack-test"
|
15
|
-
gem.require_paths = ["lib"]
|
16
9
|
gem.version = Assert::Rack::Test::VERSION
|
10
|
+
gem.authors = ["Collin Redding", "Kelly Redding"]
|
11
|
+
gem.email = ["collin.redding@me.com, kelly@kellyredding.com"]
|
12
|
+
gem.summary = "Assert with Rack::Test"
|
13
|
+
gem.description = "Assert with Rack::Test"
|
14
|
+
gem.homepage = "https://github.com/redding/assert-rack-test"
|
15
|
+
gem.license = "MIT"
|
17
16
|
|
18
|
-
gem.
|
19
|
-
gem.add_dependency("rack-test", ["~>0.6"])
|
20
|
-
end
|
17
|
+
gem.files = `git ls-files | grep "^[^.]"`.split($INPUT_RECORD_SEPARATOR)
|
21
18
|
|
19
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
20
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
21
|
+
gem.require_paths = ["lib"]
|
22
|
+
|
23
|
+
gem.required_ruby_version = "~> 2.5"
|
24
|
+
|
25
|
+
gem.add_development_dependency("assert", ["~> 2.19.3"])
|
26
|
+
gem.add_development_dependency("much-style-guide", ["~> 0.6.0"])
|
27
|
+
|
28
|
+
gem.add_dependency("rack-test", ["~> 1.1"])
|
29
|
+
end
|
data/lib/assert-rack-test.rb
CHANGED
@@ -1,18 +1,16 @@
|
|
1
|
-
|
2
|
-
require 'rack/test'
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
require
|
3
|
+
require "assert/context"
|
4
|
+
require "rack/test"
|
5
|
+
require "assert-rack-test/version"
|
5
6
|
|
6
|
-
module Assert
|
7
|
-
|
8
|
-
module Test
|
9
|
-
|
10
|
-
def self.included(klass)
|
11
|
-
klass.class_eval do
|
12
|
-
include ::Rack::Test::Methods
|
13
|
-
end
|
14
|
-
end
|
7
|
+
module Assert; end
|
8
|
+
module Assert::Rack; end
|
15
9
|
|
10
|
+
module Assert::Rack::Test
|
11
|
+
def self.included(klass)
|
12
|
+
klass.class_eval do
|
13
|
+
include ::Rack::Test::Methods
|
16
14
|
end
|
17
15
|
end
|
18
16
|
end
|
data/log/.gitkeep
ADDED
File without changes
|
data/test/helper.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# This file is automatically required when you run `assert`
|
4
|
+
# put any test helpers here.
|
5
|
+
|
6
|
+
# add the root dir to the load path
|
7
|
+
$LOAD_PATH.unshift(File.expand_path("..", __dir__))
|
8
|
+
|
9
|
+
# require pry for debugging (`binding.pry`)
|
10
|
+
require "pry"
|
11
|
+
|
12
|
+
require "test/support/factory"
|
data/test/system/.keep
ADDED
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "assert"
|
4
|
+
require "assert-rack-test"
|
5
|
+
|
6
|
+
module Assert::Rack::Test
|
7
|
+
class UnitTests < Assert::Context
|
8
|
+
desc "Assert::Context"
|
9
|
+
subject{ @context_class }
|
10
|
+
|
11
|
+
setup do
|
12
|
+
@context_class = Assert::Context
|
13
|
+
end
|
14
|
+
|
15
|
+
should "include the Rack::Test::Methods" do
|
16
|
+
assert_that(subject).includes(Rack::Test::Methods)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/tmp/.gitkeep
ADDED
File without changes
|
metadata
CHANGED
@@ -1,105 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert-rack-test
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 1.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
- Kelly Redding
|
6
|
+
authors:
|
14
7
|
- Collin Redding
|
8
|
+
- Kelly Redding
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 3
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 0
|
32
|
-
version: "2.0"
|
33
|
-
requirement: *id001
|
12
|
+
date: 2021-01-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
34
15
|
name: assert
|
35
|
-
|
36
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 2.19.3
|
21
|
+
type: :development
|
37
22
|
prerelease: false
|
38
|
-
version_requirements:
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 2.19.3
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: much-style-guide
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.6.0
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.6.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
49
43
|
name: rack-test
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - "~>"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.1'
|
50
49
|
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - "~>"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.1'
|
51
56
|
description: Assert with Rack::Test
|
52
|
-
email:
|
53
|
-
- collin.redding@me.com
|
57
|
+
email:
|
58
|
+
- collin.redding@me.com, kelly@kellyredding.com
|
54
59
|
executables: []
|
55
|
-
|
56
60
|
extensions: []
|
57
|
-
|
58
61
|
extra_rdoc_files: []
|
59
|
-
|
60
|
-
files:
|
61
|
-
- .gitignore
|
62
|
+
files:
|
62
63
|
- Gemfile
|
63
|
-
-
|
64
|
-
-
|
64
|
+
- LICENSE
|
65
|
+
- README.md
|
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/
|
70
|
-
|
71
|
-
|
72
|
-
|
71
|
+
- test/support/factory.rb
|
72
|
+
- test/system/.keep
|
73
|
+
- test/unit/assert-rack-test_tests.rb
|
74
|
+
- tmp/.gitkeep
|
75
|
+
homepage: https://github.com/redding/assert-rack-test
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
73
79
|
post_install_message:
|
74
80
|
rdoc_options: []
|
75
|
-
|
76
|
-
require_paths:
|
81
|
+
require_paths:
|
77
82
|
- lib
|
78
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
- 0
|
86
|
-
version: "0"
|
87
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
|
-
requirements:
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '2.5'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
90
|
- - ">="
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
version: "0"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
96
93
|
requirements: []
|
97
|
-
|
98
|
-
rubyforge_project:
|
99
|
-
rubygems_version: 1.8.15
|
94
|
+
rubygems_version: 3.2.4
|
100
95
|
signing_key:
|
101
|
-
specification_version:
|
96
|
+
specification_version: 4
|
102
97
|
summary: Assert with Rack::Test
|
103
|
-
test_files:
|
98
|
+
test_files:
|
104
99
|
- test/helper.rb
|
105
|
-
- test/
|
100
|
+
- test/support/factory.rb
|
101
|
+
- test/system/.keep
|
102
|
+
- test/unit/assert-rack-test_tests.rb
|
data/.gitignore
DELETED
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.
|
data/Rakefile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'assert'
|
2
|
-
|
3
|
-
module Assert::Rack::Test
|
4
|
-
|
5
|
-
class BaseTest < Assert::Context
|
6
|
-
desc "Assert::Context"
|
7
|
-
setup do
|
8
|
-
@class = Assert::Context
|
9
|
-
@instance = Assert::Context.new
|
10
|
-
end
|
11
|
-
subject{ @instance }
|
12
|
-
|
13
|
-
should have_instance_methods :get, :post, :put, :delete
|
14
|
-
|
15
|
-
should "include the Rack::Test::Methods" do
|
16
|
-
assert_includes Rack::Test::Methods, @class.included_modules
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|