assert-rack-test 1.0.2 → 1.0.3

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/.gitignore CHANGED
@@ -1,5 +1,7 @@
1
1
  *.gem
2
+ *.log
2
3
  *.rbc
4
+ .rbx/
3
5
  .bundle
4
6
  .config
5
7
  .yardoc
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source 'http://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gem 'rake', '~> 0.9.2'
4
-
5
- # Specify your gem's dependencies in assert-rack-test.gemspec
6
3
  gemspec
4
+
5
+ gem 'rake'
6
+ gem 'pry'
@@ -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.
@@ -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
@@ -1,2 +1 @@
1
- #!/usr/bin/env rake
2
1
  require "bundler/gem_tasks"
@@ -1,21 +1,24 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/assert-rack-test/version', __FILE__)
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.authors = ["Kelly Redding", "Collin Redding"]
6
- gem.email = ["collin.redding@me.com"]
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.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
- gem.files = `git ls-files`.split("\n")
13
- gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
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", ["~>2.0"])
19
- gem.add_dependency("rack-test", ["~>0.6"])
20
+ gem.add_dependency("assert", ["~> 2.0"])
21
+ gem.add_dependency("rack-test", ["~> 0.6"])
22
+
20
23
  end
21
24
 
@@ -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
@@ -1,7 +1,5 @@
1
- module Assert
2
- module Rack
3
- module Test
4
- VERSION = "1.0.2"
5
- end
6
- end
1
+ module Assert; end
2
+ module Assert::Rack; end
3
+ module Assert::Rack::Test
4
+ VERSION = "1.0.3"
7
5
  end
File without changes
@@ -1,5 +1,9 @@
1
- root_path = File.expand_path("../..", __FILE__)
2
- if !$LOAD_PATH.include?(root_path)
3
- $LOAD_PATH.unshift(root_path)
4
- end
5
- require 'assert-rack-test'
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
+
@@ -1,8 +1,9 @@
1
1
  require 'assert'
2
+ require 'assert-rack-test'
2
3
 
3
4
  module Assert::Rack::Test
4
5
 
5
- class BaseTest < Assert::Context
6
+ class BaseTests < Assert::Context
6
7
  desc "Assert::Context"
7
8
  setup do
8
9
  @class = Assert::Context
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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 2
10
- version: 1.0.2
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-07 00:00:00 Z
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
- version_requirements: &id001 !ruby/object:Gem::Requirement
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
- version_requirements: &id002 !ruby/object:Gem::Requirement
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
- - README.markdown
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-test_test.rb
70
- homepage: ""
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.15
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-test_test.rb
108
+ - test/unit/assert-rack-test_tests.rb
@@ -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.