rspec-padrino 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  # http://about.travis-ci.org/docs/user/build-configuration/
2
2
  rvm:
3
3
  - 1.8.7
4
- - 1.9.2
5
- - 1.9.3-p0
4
+ - 1.9.3
6
5
  notifications:
7
6
  email:
8
7
  - udzura@udzura.jp
data/Gemfile CHANGED
@@ -4,14 +4,19 @@ source "http://rubygems.org"
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
  gem "sinatra"
6
6
  gem "padrino-core", ">= 0.10.2"
7
- gem "rspec", ">= 2.3"
7
+ gem "rspec", ">= 2.0"
8
8
  gem "rack-test", ">= 0"
9
9
 
10
+ platform :mri_18 do
11
+ gem 'pry'
12
+ end
13
+
10
14
  # Add dependencies to develop your gem here.
11
15
  # Include everything needed to run rake, tests, features, etc.
12
16
  group :development do
13
17
  gem 'rdoc'
14
- gem "bundler", "~> 1.0.0"
18
+ gem "bundler"
15
19
  gem "jeweler", "~> 1.6.4"
16
- gem "rcov", ">= 0"
20
+ gem "simplecov", ">= 0"
21
+ gem 'pry'
17
22
  end
data/Gemfile.lock CHANGED
@@ -1,46 +1,58 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (3.1.3)
4
+ activesupport (3.2.3)
5
+ i18n (~> 0.6)
5
6
  multi_json (~> 1.0)
7
+ coderay (1.0.6)
6
8
  diff-lcs (1.1.3)
7
9
  git (1.2.5)
8
10
  http_router (0.10.2)
9
11
  rack (>= 1.0.0)
10
12
  url_mount (~> 0.2.1)
13
+ i18n (0.6.0)
11
14
  jeweler (1.6.4)
12
15
  bundler (~> 1.0)
13
16
  git (>= 1.2.5)
14
17
  rake
15
- json (1.6.3)
16
- multi_json (1.0.4)
17
- padrino-core (0.10.5)
18
- activesupport (~> 3.1.0)
18
+ json (1.7.3)
19
+ method_source (0.7.1)
20
+ multi_json (1.3.5)
21
+ padrino-core (0.10.6)
22
+ activesupport (~> 3.2.0)
19
23
  http_router (~> 0.10.2)
20
24
  sinatra (~> 1.3.1)
21
25
  thor (~> 0.14.3)
22
26
  tilt (~> 1.3.0)
23
- rack (1.3.5)
24
- rack-protection (1.1.4)
27
+ pry (0.9.9.6)
28
+ coderay (~> 1.0.5)
29
+ method_source (~> 0.7.1)
30
+ slop (>= 2.4.4, < 3)
31
+ rack (1.4.1)
32
+ rack-protection (1.2.0)
25
33
  rack
26
34
  rack-test (0.6.1)
27
35
  rack (>= 1.0)
28
36
  rake (0.9.2.2)
29
- rcov (0.9.11)
30
- rdoc (3.11)
37
+ rdoc (3.12)
31
38
  json (~> 1.4)
32
- rspec (2.7.0)
33
- rspec-core (~> 2.7.0)
34
- rspec-expectations (~> 2.7.0)
35
- rspec-mocks (~> 2.7.0)
36
- rspec-core (2.7.1)
37
- rspec-expectations (2.7.0)
38
- diff-lcs (~> 1.1.2)
39
- rspec-mocks (2.7.0)
40
- sinatra (1.3.1)
41
- rack (~> 1.3, >= 1.3.4)
42
- rack-protection (~> 1.1, >= 1.1.2)
39
+ rspec (2.10.0)
40
+ rspec-core (~> 2.10.0)
41
+ rspec-expectations (~> 2.10.0)
42
+ rspec-mocks (~> 2.10.0)
43
+ rspec-core (2.10.0)
44
+ rspec-expectations (2.10.0)
45
+ diff-lcs (~> 1.1.3)
46
+ rspec-mocks (2.10.1)
47
+ simplecov (0.6.4)
48
+ multi_json (~> 1.0)
49
+ simplecov-html (~> 0.5.3)
50
+ simplecov-html (0.5.3)
51
+ sinatra (1.3.2)
52
+ rack (~> 1.3, >= 1.3.6)
53
+ rack-protection (~> 1.2)
43
54
  tilt (~> 1.3, >= 1.3.3)
55
+ slop (2.4.4)
44
56
  thor (0.14.6)
45
57
  tilt (1.3.3)
46
58
  url_mount (0.2.1)
@@ -50,11 +62,12 @@ PLATFORMS
50
62
  ruby
51
63
 
52
64
  DEPENDENCIES
53
- bundler (~> 1.0.0)
65
+ bundler
54
66
  jeweler (~> 1.6.4)
55
67
  padrino-core (>= 0.10.2)
68
+ pry
56
69
  rack-test
57
- rcov
58
70
  rdoc
59
- rspec (>= 2.3)
71
+ rspec (>= 2.0)
72
+ simplecov
60
73
  sinatra
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
@@ -10,7 +10,7 @@ Sinatra::Base.class_eval do
10
10
  last_app = _dup
11
11
  _dup.call!(env)
12
12
  end
13
-
13
+
14
14
  def assigns(sym)
15
15
  valname = (RUBY_VERSION > '1.9') ? :"@#{sym}" : "@#{sym}"
16
16
  instance_variables.include?(valname) ? instance_variable_get(valname) : nil
@@ -1,5 +1,7 @@
1
1
  require 'sinatra/base'
2
2
  require 'padrino-core'
3
+ # defining Proc#source_location
4
+ require 'pry' if RUBY_VERSION < '1.9'
3
5
 
4
6
  module RSpec::Padrino::Matchers
5
7
  module RoutingMatchers
@@ -9,6 +11,7 @@ module RSpec::Padrino::Matchers
9
11
  @_routing_matchers_hook = lambda do
10
12
  apps = Padrino.mounted_apps.map(&:app_obj)
11
13
  apps.each do |the_app|
14
+ next if the_app.filters[:after].find{|filter| filter.source_location[0] =~ /#{__FILE__}/ }
12
15
  the_app.class_eval do
13
16
  after do
14
17
  last_params = params
@@ -17,11 +20,15 @@ module RSpec::Padrino::Matchers
17
20
  end
18
21
  end
19
22
  end
20
-
23
+
21
24
  def self.hook!
22
25
  @_routing_matchers_hook.call
23
26
  end
24
27
 
28
+ def self.after_hook!
29
+ @_routing_matchers_hook.call
30
+ end
31
+
25
32
  extend RSpec::Matchers::DSL
26
33
 
27
34
  matcher :route_to do |*expected|
@@ -4,7 +4,7 @@ module RSpec::Padrino
4
4
  def self.included(base)
5
5
  base.send :include, RSpec::Padrino::Matchers::RoutingMatchers
6
6
  RSpec.configure do |c|
7
- c.before {
7
+ c.before(:all) {
8
8
  RSpec::Padrino::Matchers::RoutingMatchers.hook!
9
9
  }
10
10
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rspec-padrino"
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Uchio Kondo"]
12
- s.date = "2011-12-10"
12
+ s.date = "2012-05-12"
13
13
  s.description = "rspec-padrino is a gem including helpers for testing a Padrino app using RSpec. Taking much from rspec-rails."
14
14
  s.email = "udzura@udzura.jp"
15
15
  s.extra_rdoc_files = [
@@ -37,13 +37,14 @@ Gem::Specification.new do |s|
37
37
  "spec/integrations/matchers_spec.rb",
38
38
  "spec/integrations/mock_app_helper.rb",
39
39
  "spec/rspec-padrino_spec.rb",
40
+ "spec/rspec/padrino/matchers_spec.rb",
40
41
  "spec/spec.opts",
41
42
  "spec/spec_helper.rb"
42
43
  ]
43
44
  s.homepage = "http://github.com/udzura/rspec-padrino"
44
45
  s.licenses = ["MIT"]
45
46
  s.require_paths = ["lib"]
46
- s.rubygems_version = "1.8.10"
47
+ s.rubygems_version = "1.8.19"
47
48
  s.summary = "rspec-padrino is a gem including helpers for testing a Padrino app."
48
49
 
49
50
  if s.respond_to? :specification_version then
@@ -52,31 +53,37 @@ Gem::Specification.new do |s|
52
53
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
54
  s.add_runtime_dependency(%q<sinatra>, [">= 0"])
54
55
  s.add_runtime_dependency(%q<padrino-core>, [">= 0.10.2"])
55
- s.add_runtime_dependency(%q<rspec>, [">= 2.3"])
56
+ s.add_runtime_dependency(%q<rspec>, [">= 2.0"])
56
57
  s.add_runtime_dependency(%q<rack-test>, [">= 0"])
58
+ s.add_runtime_dependency(%q<pry>, [">= 0"])
57
59
  s.add_development_dependency(%q<rdoc>, [">= 0"])
58
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
60
+ s.add_development_dependency(%q<bundler>, [">= 0"])
59
61
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
60
- s.add_development_dependency(%q<rcov>, [">= 0"])
62
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
63
+ s.add_development_dependency(%q<pry>, [">= 0"])
61
64
  else
62
65
  s.add_dependency(%q<sinatra>, [">= 0"])
63
66
  s.add_dependency(%q<padrino-core>, [">= 0.10.2"])
64
- s.add_dependency(%q<rspec>, [">= 2.3"])
67
+ s.add_dependency(%q<rspec>, [">= 2.0"])
65
68
  s.add_dependency(%q<rack-test>, [">= 0"])
69
+ s.add_dependency(%q<pry>, [">= 0"])
66
70
  s.add_dependency(%q<rdoc>, [">= 0"])
67
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
71
+ s.add_dependency(%q<bundler>, [">= 0"])
68
72
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
69
- s.add_dependency(%q<rcov>, [">= 0"])
73
+ s.add_dependency(%q<simplecov>, [">= 0"])
74
+ s.add_dependency(%q<pry>, [">= 0"])
70
75
  end
71
76
  else
72
77
  s.add_dependency(%q<sinatra>, [">= 0"])
73
78
  s.add_dependency(%q<padrino-core>, [">= 0.10.2"])
74
- s.add_dependency(%q<rspec>, [">= 2.3"])
79
+ s.add_dependency(%q<rspec>, [">= 2.0"])
75
80
  s.add_dependency(%q<rack-test>, [">= 0"])
81
+ s.add_dependency(%q<pry>, [">= 0"])
76
82
  s.add_dependency(%q<rdoc>, [">= 0"])
77
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
83
+ s.add_dependency(%q<bundler>, [">= 0"])
78
84
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
79
- s.add_dependency(%q<rcov>, [">= 0"])
85
+ s.add_dependency(%q<simplecov>, [">= 0"])
86
+ s.add_dependency(%q<pry>, [">= 0"])
80
87
  end
81
88
  end
82
89
 
@@ -11,11 +11,11 @@ class TestApp < Padrino::Application
11
11
  get :index do
12
12
  "foo"
13
13
  end
14
-
14
+
15
15
  get :show, :with => :id do
16
16
  "foo"
17
17
  end
18
-
18
+
19
19
  get :show2, '/custom/:id/path' do
20
20
  "foo"
21
21
  end
@@ -0,0 +1,15 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+ require File.expand_path(File.dirname(__FILE__) + '/../../integrations/mock_app_helper')
3
+
4
+ describe RSpec::Padrino::Matchers do
5
+ describe 'RoutingMatchers.hook! adds a filter' do
6
+ subject { TestApp.filters[:after] }
7
+ before { RSpec::Padrino::Matchers::RoutingMatchers.hook! }
8
+ it { should have(1).filter }
9
+
10
+ describe 'should not add second filter hook' do
11
+ before { RSpec::Padrino::Matchers::RoutingMatchers.hook! }
12
+ it { should have(1).filter }
13
+ end
14
+ end
15
+ end
@@ -4,7 +4,7 @@ describe RSpec::Padrino do
4
4
  it "can be included" do
5
5
  lambda { include RSpec::Padrino }.should_not raise_error
6
6
  end
7
-
7
+
8
8
  it "includes RSpec::Padrino::* automatically" do
9
9
  module Foo
10
10
  include RSpec::Padrino
data/spec/spec_helper.rb CHANGED
@@ -8,5 +8,5 @@ require 'rspec-padrino'
8
8
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
9
 
10
10
  RSpec.configure do |config|
11
-
11
+ # none
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-padrino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-10 00:00:00.000000000Z
12
+ date: 2012-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &89263400 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *89263400
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: padrino-core
27
- requirement: &89263130 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,21 +37,47 @@ dependencies:
32
37
  version: 0.10.2
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *89263130
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.10.2
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: rspec
38
- requirement: &89262890 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
42
52
  - !ruby/object:Gem::Version
43
- version: '2.3'
53
+ version: '2.0'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *89262890
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rack-test
49
- requirement: &89262640 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: pry
80
+ requirement: !ruby/object:Gem::Requirement
50
81
  none: false
51
82
  requirements:
52
83
  - - ! '>='
@@ -54,10 +85,15 @@ dependencies:
54
85
  version: '0'
55
86
  type: :runtime
56
87
  prerelease: false
57
- version_requirements: *89262640
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
58
94
  - !ruby/object:Gem::Dependency
59
95
  name: rdoc
60
- requirement: &89262320 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
61
97
  none: false
62
98
  requirements:
63
99
  - - ! '>='
@@ -65,32 +101,63 @@ dependencies:
65
101
  version: '0'
66
102
  type: :development
67
103
  prerelease: false
68
- version_requirements: *89262320
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
69
110
  - !ruby/object:Gem::Dependency
70
111
  name: bundler
71
- requirement: &89239830 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
72
113
  none: false
73
114
  requirements:
74
- - - ~>
115
+ - - ! '>='
75
116
  - !ruby/object:Gem::Version
76
- version: 1.0.0
117
+ version: '0'
77
118
  type: :development
78
119
  prerelease: false
79
- version_requirements: *89239830
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
80
126
  - !ruby/object:Gem::Dependency
81
127
  name: jeweler
82
- requirement: &89239420 !ruby/object:Gem::Requirement
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: 1.6.4
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
83
137
  none: false
84
138
  requirements:
85
139
  - - ~>
86
140
  - !ruby/object:Gem::Version
87
141
  version: 1.6.4
142
+ - !ruby/object:Gem::Dependency
143
+ name: simplecov
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
88
150
  type: :development
89
151
  prerelease: false
90
- version_requirements: *89239420
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
91
158
  - !ruby/object:Gem::Dependency
92
- name: rcov
93
- requirement: &89239060 !ruby/object:Gem::Requirement
159
+ name: pry
160
+ requirement: !ruby/object:Gem::Requirement
94
161
  none: false
95
162
  requirements:
96
163
  - - ! '>='
@@ -98,7 +165,12 @@ dependencies:
98
165
  version: '0'
99
166
  type: :development
100
167
  prerelease: false
101
- version_requirements: *89239060
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
102
174
  description: rspec-padrino is a gem including helpers for testing a Padrino app using
103
175
  RSpec. Taking much from rspec-rails.
104
176
  email: udzura@udzura.jp
@@ -128,6 +200,7 @@ files:
128
200
  - spec/integrations/matchers_spec.rb
129
201
  - spec/integrations/mock_app_helper.rb
130
202
  - spec/rspec-padrino_spec.rb
203
+ - spec/rspec/padrino/matchers_spec.rb
131
204
  - spec/spec.opts
132
205
  - spec/spec_helper.rb
133
206
  homepage: http://github.com/udzura/rspec-padrino
@@ -145,7 +218,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
218
  version: '0'
146
219
  segments:
147
220
  - 0
148
- hash: -531388223
221
+ hash: -3565863233537445049
149
222
  required_rubygems_version: !ruby/object:Gem::Requirement
150
223
  none: false
151
224
  requirements:
@@ -154,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
227
  version: '0'
155
228
  requirements: []
156
229
  rubyforge_project:
157
- rubygems_version: 1.8.10
230
+ rubygems_version: 1.8.19
158
231
  signing_key:
159
232
  specification_version: 3
160
233
  summary: rspec-padrino is a gem including helpers for testing a Padrino app.