rspec-padrino 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69a8770e87105f57353bfa3bac01dd75fdd99033
4
- data.tar.gz: 437ff957f93c13945b4cdb739ac3de43461072b5
3
+ metadata.gz: 2424c0e846ffe5f73f15552b2607af792f713fa9
4
+ data.tar.gz: 623017cea2dd8801b31a01053b9bce8a878d4c53
5
5
  SHA512:
6
- metadata.gz: 85d40634112d4ce32a9cbc03190e21f38fdcbda92798712b120dafa28be5ce9fc32d43052ad01ccee3ba0d19fbcd0c15b63ae5efe8d2c2680fb8273f49a600fe
7
- data.tar.gz: 1dc4ead961325b424591fda8544a86db63d9e7bd83f801d569f14ce95799c309476a3a6cc77892228539510a737fad142308cfa8873a870451b8dc0ac10f8e95
6
+ metadata.gz: b36331c1dc6f51f8f584bf5e9f1d21b14222ba8f72f17f93b733d5553b195662f0d457aa4c09f3b871e4e5bb795b117de59a6964b8406393a148a6215e2b2b58
7
+ data.tar.gz: e44f084720c4bcff64dd59770de62fb35b42898f3bebf05e65bf195001ddffe8ba58385ec611e51c6335360396253c072c6ff5939cfd938a56159b517859fe0c
@@ -1,9 +1,8 @@
1
1
  # http://about.travis-ci.org/docs/user/build-configuration/
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1
6
- - 2.2
3
+ - 2.2.6
4
+ - 2.3.4
5
+ - 2.4.1
7
6
  notifications:
8
7
  email:
9
8
  - udzura@udzura.jp
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org"
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
5
5
  gem "sinatra"
6
- gem "padrino-core", "~> 0.13.0.beta1"
6
+ gem "padrino-core", ">= 0.13.3.1"
7
7
  gem "rspec", ">= 2.0"
8
8
  gem "rack-test", ">= 0"
9
9
 
@@ -14,7 +14,7 @@ end
14
14
  # Add dependencies to develop your gem here.
15
15
  # Include everything needed to run rake, tests, features, etc.
16
16
  group :development do
17
- gem "padrino-helpers", "~> 0.13.0.beta1"
17
+ gem "padrino-helpers", ">= 0.13.3.1"
18
18
  gem 'rdoc'
19
19
  gem "bundler"
20
20
  gem "jeweler", "~> 1.6.4"
@@ -1,77 +1,69 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activesupport (4.2.0)
5
- i18n (~> 0.7)
6
- json (~> 1.7, >= 1.7.7)
7
- minitest (~> 5.1)
8
- thread_safe (~> 0.3, >= 0.3.4)
9
- tzinfo (~> 1.1)
10
- coderay (1.1.0)
11
- diff-lcs (1.2.5)
12
- docile (1.1.3)
13
- enumerable-lazy (0.0.1)
14
- git (1.2.6)
15
- i18n (0.7.0)
4
+ coderay (1.1.1)
5
+ diff-lcs (1.3)
6
+ docile (1.1.5)
7
+ enumerable-lazy (0.0.2)
8
+ git (1.3.0)
9
+ i18n (0.8.1)
16
10
  jeweler (1.6.4)
17
11
  bundler (~> 1.0)
18
12
  git (>= 1.2.5)
19
13
  rake
20
- json (1.8.1)
14
+ json (2.1.0)
21
15
  method_source (0.8.2)
22
- minitest (5.5.1)
23
- multi_json (1.11.0)
24
- mustermann19 (0.4.0)
16
+ mustermann (1.0.0)
17
+ mustermann19 (0.4.4)
25
18
  enumerable-lazy
26
- padrino-core (0.13.0.beta1)
27
- activesupport (>= 3.1)
19
+ padrino-core (0.14.1.1)
28
20
  mustermann19
29
- padrino-support (= 0.13.0.beta1)
30
- rack (< 1.6.0)
21
+ padrino-support (= 0.14.1.1)
31
22
  rack-protection (>= 1.5.0)
32
- sinatra (~> 1.4.2)
23
+ sinatra (>= 1.4.6)
33
24
  thor (~> 0.18)
34
- padrino-helpers (0.13.0.beta1)
25
+ padrino-helpers (0.14.1.1)
35
26
  i18n (~> 0.6, >= 0.6.7)
36
- padrino-support (= 0.13.0.beta1)
37
- tilt (~> 1.4.1)
38
- padrino-support (0.13.0.beta1)
39
- activesupport (>= 3.1)
40
- pry (0.9.12.6)
41
- coderay (~> 1.0)
42
- method_source (~> 0.8)
27
+ padrino-support (= 0.14.1.1)
28
+ tilt (>= 1.4.1, < 3)
29
+ padrino-support (0.14.1.1)
30
+ pry (0.10.4)
31
+ coderay (~> 1.1.0)
32
+ method_source (~> 0.8.1)
43
33
  slop (~> 3.4)
44
- rack (1.5.2)
45
- rack-protection (1.5.3)
34
+ rack (2.0.3)
35
+ rack-protection (2.0.0)
46
36
  rack
47
- rack-test (0.6.2)
37
+ rack-test (0.6.3)
48
38
  rack (>= 1.0)
49
- rake (10.2.2)
50
- rdoc (4.1.1)
51
- json (~> 1.4)
52
- rspec (2.14.1)
53
- rspec-core (~> 2.14.0)
54
- rspec-expectations (~> 2.14.0)
55
- rspec-mocks (~> 2.14.0)
56
- rspec-core (2.14.8)
57
- rspec-expectations (2.14.5)
58
- diff-lcs (>= 1.1.3, < 2.0)
59
- rspec-mocks (2.14.6)
60
- simplecov (0.8.2)
39
+ rake (12.0.0)
40
+ rdoc (5.1.0)
41
+ rspec (3.6.0)
42
+ rspec-core (~> 3.6.0)
43
+ rspec-expectations (~> 3.6.0)
44
+ rspec-mocks (~> 3.6.0)
45
+ rspec-core (3.6.0)
46
+ rspec-support (~> 3.6.0)
47
+ rspec-expectations (3.6.0)
48
+ diff-lcs (>= 1.2.0, < 2.0)
49
+ rspec-support (~> 3.6.0)
50
+ rspec-mocks (3.6.0)
51
+ diff-lcs (>= 1.2.0, < 2.0)
52
+ rspec-support (~> 3.6.0)
53
+ rspec-support (3.6.0)
54
+ simplecov (0.14.1)
61
55
  docile (~> 1.1.0)
62
- multi_json
63
- simplecov-html (~> 0.8.0)
64
- simplecov-html (0.8.0)
65
- sinatra (1.4.5)
66
- rack (~> 1.4)
67
- rack-protection (~> 1.4)
68
- tilt (~> 1.3, >= 1.3.4)
69
- slop (3.5.0)
70
- thor (0.19.1)
71
- thread_safe (0.3.4)
72
- tilt (1.4.1)
73
- tzinfo (1.2.2)
74
- thread_safe (~> 0.1)
56
+ json (>= 1.8, < 3)
57
+ simplecov-html (~> 0.10.0)
58
+ simplecov-html (0.10.1)
59
+ sinatra (2.0.0)
60
+ mustermann (~> 1.0)
61
+ rack (~> 2.0)
62
+ rack-protection (= 2.0.0)
63
+ tilt (~> 2.0)
64
+ slop (3.6.0)
65
+ thor (0.19.4)
66
+ tilt (2.0.7)
75
67
 
76
68
  PLATFORMS
77
69
  ruby
@@ -79,11 +71,14 @@ PLATFORMS
79
71
  DEPENDENCIES
80
72
  bundler
81
73
  jeweler (~> 1.6.4)
82
- padrino-core (~> 0.13.0.beta1)
83
- padrino-helpers (~> 0.13.0.beta1)
74
+ padrino-core (>= 0.13.3.1)
75
+ padrino-helpers (>= 0.13.3.1)
84
76
  pry
85
77
  rack-test
86
78
  rdoc
87
79
  rspec (>= 2.0)
88
80
  simplecov
89
81
  sinatra
82
+
83
+ BUNDLED WITH
84
+ 1.12.5
data/Rakefile CHANGED
@@ -5,12 +5,12 @@ require 'rspec/core'
5
5
  require 'rspec/core/rake_task'
6
6
  RSpec::Core::RakeTask.new(:spec) do |spec|
7
7
  spec.pattern = FileList['spec/**/*_spec.rb']
8
- spec.rspec_opts = "-fs --color"
8
+ spec.rspec_opts = "--format=documentation --color"
9
9
  end
10
10
 
11
11
  RSpec::Core::RakeTask.new(:"spec:integrations") do |spec|
12
12
  spec.pattern = FileList['spec/integrations/**/*_spec.rb']
13
- spec.rspec_opts = "-fs --color"
13
+ spec.rspec_opts = "--format=documentation --color"
14
14
  end
15
15
 
16
16
  RSpec::Core::RakeTask.new(:rcov) do |spec|
@@ -19,11 +19,11 @@ module RSpec::Padrino::Matchers
19
19
  end
20
20
  end
21
21
 
22
- failure_message_for_should do |actual|
22
+ failure_message do |actual|
23
23
  "expected #{actual} to be a redirect to #{@expected_url}, got #{@actual_url.inspect}"
24
24
  end
25
25
 
26
- failure_message_for_should_not do |actual|
26
+ failure_message_when_negated do |actual|
27
27
  "expected #{actual} not to be a redirect to #{@expected_url}, got #{@actual_url.inspect}"
28
28
  end
29
29
  end
@@ -15,7 +15,7 @@ module RSpec::Padrino::Matchers
15
15
  match do |verb_to_path_map|
16
16
  expected_names = expected.select{|v| Symbol === v }
17
17
  expected_params = expected.select{|v| Hash === v }.first || {}
18
- expected_routes = expected_names.dup.tap{|exp| exp << expected_params.symbolize_keys }
18
+ expected_routes = expected_names.dup.tap{|exp| exp << expected_params }
19
19
  path = verb_to_path_map.values.first
20
20
  method = verb_to_path_map.keys.first
21
21
  begin
@@ -26,18 +26,18 @@ module RSpec::Padrino::Matchers
26
26
  last_route, last_params = *last_application.get_requested_routes_and_params
27
27
  last_name = last_route ? last_route.name : nil
28
28
  last_name == expected_names.join(" ").to_sym &&
29
- last_params.symbolize_keys == expected_params.symbolize_keys
29
+ last_params == expected_params
30
30
  end
31
31
 
32
- failure_message_for_should do |actual|
32
+ failure_message do |actual|
33
33
  last_names = last_name.to_s.split(" ", 2).map(&:to_sym)
34
- last_names << last_params.symbolize_keys rescue nil
34
+ last_names << last_params
35
35
  "expected #{actual.inspect} to route to #{expected_routes.inspect}, got #{last_names.inspect}"
36
36
  end
37
37
 
38
- failure_message_for_should_not do |actual|
38
+ failure_message_when_negated do |actual|
39
39
  last_names = last_name.to_s.split(" ", 2).map(&:to_sym)
40
- last_names << last_params.symbolize_keys rescue nil
40
+ last_names << last_params
41
41
  "expected #{actual.inspect} not to route to #{expected.inspect}, got #{last_names.inspect}"
42
42
  end
43
43
  end
@@ -51,11 +51,11 @@ module RSpec::Padrino::Matchers
51
51
  path = verb_to_path_map.values.first
52
52
  method = verb_to_path_map.keys.first.to_s.upcase
53
53
  @routed_to = Padrino.mounted_apps.map(&:app_obj).
54
- map{|a| a.router.recognize(Rack::MockRequest.env_for(path, :method => method))}.first
54
+ map{|a| a.router.recognize(Rack::MockRequest.env_for(path, method: method))}.first
55
55
  @routed_to.first
56
56
  end
57
57
 
58
- failure_message_for_should_not do |path|
58
+ failure_message_when_negated do |path|
59
59
  "expected #{path.inspect} not to be routable, but it routes to #{@routed_to.inspect}"
60
60
  end
61
61
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Padrino
3
- VERSION = "0.2.3"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_runtime_dependency "sinatra", ">= 0"
22
- spec.add_runtime_dependency "padrino-core", ">= 0.13.0"
22
+ spec.add_runtime_dependency "padrino-core", ">= 0.13.3.1"
23
23
  spec.add_runtime_dependency "rspec", ">= 2.0"
24
24
  spec.add_runtime_dependency "rack-test", ">= 0"
25
25
 
26
- spec.add_development_dependency "padrino-helpers", ">= 0.13.0"
26
+ spec.add_development_dependency "padrino-helpers", ">= 0.13.3.1"
27
27
  spec.add_development_dependency "rdoc", ">= 0"
28
28
  spec.add_development_dependency "bundler", "~> 1.3"
29
29
  spec.add_development_dependency "simplecov", ">= 0"
@@ -7,18 +7,18 @@ describe "Integrations" do
7
7
 
8
8
  it "exists" do
9
9
  get "/foo"
10
- should_not be_nil
10
+ is_expected.not_to be_nil
11
11
  end
12
12
 
13
13
  it "is an instance of PadrinoApp" do
14
14
  get "/foo"
15
- should be_kind_of(TestApp)
15
+ is_expected.to be_kind_of(TestApp)
16
16
  end
17
17
 
18
18
  it "exists with assignment" do
19
19
  get "/foo/assign"
20
- last_application.assigns(:nonexist).should be_nil
21
- last_application.assigns(:assigned).should eq(1)
20
+ expect(last_application.assigns(:nonexist)).to be_nil
21
+ expect(last_application.assigns(:assigned)).to eq(1)
22
22
  end
23
23
  end
24
24
  end
@@ -4,63 +4,65 @@ require File.expand_path(File.dirname(__FILE__) + '/mock_app_helper')
4
4
  describe "Integrations" do
5
5
  context "routing" do
6
6
  it "routes to /foo" do
7
- {:get => "/foo"}.should route_to(:foo, :index)
7
+ expect({get: "/foo"}).to route_to(:foo, :index)
8
8
  end
9
9
 
10
10
  it "should not route to /bar" do
11
- {:get => "/bar"}.should_not route_to(:bar, :index)
11
+ expect({get: "/bar"}).not_to route_to(:bar, :index)
12
12
  end
13
13
 
14
14
  it "routes to /foo/create" do
15
- {:post => "/foo/create"}.should route_to(:foo, :create)
15
+ expect({post: "/foo/create"}).to route_to(:foo, :create)
16
16
  end
17
17
 
18
18
  it "routes to /foo/assign" do
19
- {:get => "/foo/assign"}.should route_to(:foo, :assign)
19
+ expect({get: "/foo/assign"}).to route_to(:foo, :assign)
20
20
  end
21
21
 
22
22
  it "routes to /foo/show/1" do
23
- {:get => "/foo/show/1"}.should route_to(:foo, :show, :id => "1")
23
+ expect({get: "/foo/show/1"}).to route_to(:foo, :show, "id" => "1")
24
24
  end
25
25
 
26
26
  it "routes to /custom/123/path" do
27
- {:get => "/custom/123/path"}.should route_to(:foo, :show2, :id => "123")
27
+ expect({get: "/custom/123/path"}).to route_to(:foo, :show2, "id" => "123")
28
28
  end
29
29
 
30
30
  it "routes to /foo/assign?par=ams" do
31
- {:get => "/foo/assign?par=ams"}.should route_to(:foo, :assign, :par => "ams")
31
+ expect({get: "/foo/assign?par=ams"}).to route_to(:foo, :assign, "par" => "ams")
32
32
  end
33
33
 
34
- it "routes to /foo/errored if it has error", pending: "Fails only in travis ci, passes locally" do
35
- {:get => "/foo/errored"}.should route_to(:foo, :errored)
34
+ pending "Fails only in travis ci, passes locally" do
35
+ it "routes to /foo/errored if it has error" do
36
+ expect({get: "/foo/errored"}).to route_to(:foo, :errored)
37
+ end
36
38
  end
37
39
 
38
40
  it "is not routeble on /" do
39
- {:get => "/"}.should_not be_routable
41
+ expect({get: "/"}).not_to be_routable
40
42
  end
41
43
 
42
44
  it "is routable on /foo" do
43
- {:get => "/foo"}.should be_routable
45
+ expect({get: "/foo"}).to be_routable
44
46
  end
45
47
 
46
48
  it "is routable on /foo/show/1" do
47
- {:get => "/foo/show/1"}.should be_routable
49
+ expect({get: "/foo/show/1"}).to be_routable
48
50
  end
49
51
 
50
52
  it "is routable on /custom/123/path" do
51
- {:get => "/custom/123/path"}.should be_routable
53
+ expect({get: "/custom/123/path"}).to be_routable
52
54
  end
53
55
 
54
56
  it "is routable on /foo?par=ams" do
55
- {:get => "/foo?par=ams"}.should be_routable
57
+ expect({get: "/foo?par=ams"}).to be_routable
56
58
  end
57
59
 
58
60
  it "is routable on /foo/create with method POST" do
59
- {:post => "/foo/create"}.should be_routable
61
+ expect({post: "/foo/create"}).to be_routable
60
62
  end
61
63
 
62
64
  it "is routable on /foo/errored" do
63
- {:get => "/foo/errored"}.should be_routable
65
+ expect({get: "/foo/errored"}).to be_routable
64
66
  end
65
67
  end
66
68
 
@@ -70,51 +72,51 @@ describe "Integrations" do
70
72
  context "with optional style" do
71
73
  it "redirects to /baz/show" do
72
74
  get "/baz"
73
- should redirect_to(:baz, :show)
75
+ is_expected.to redirect_to(:baz, :show)
74
76
  end
75
77
 
76
78
  it "redirects to /baz/captures/123" do
77
79
  get "/baz/redirect_with_captures/123"
78
- should redirect_to(:baz, :captures, :id => 123)
80
+ is_expected.to redirect_to(:baz, :captures, id: 123)
79
81
  end
80
82
 
81
83
  it "should fail if does not redirect" do
82
84
  get "/baz/captures/123"
83
- should_not redirect_to(:baz, :captures, :id => 123)
85
+ is_expected.not_to redirect_to(:baz, :captures, id: 123)
84
86
  end
85
87
 
86
88
  it "should not fail even if only one argument is an instance of non-string" do
87
89
  get "/cushion", q: "/one"
88
- should redirect_to(:one)
90
+ is_expected.to redirect_to(:one)
89
91
  end
90
92
  end
91
93
 
92
94
  context "with URI" do
93
95
  it "redirects to /baz/show" do
94
96
  get "/baz"
95
- should redirect_to("/baz/show")
97
+ is_expected.to redirect_to("/baz/show")
96
98
  end
97
99
 
98
100
  it "redirects to /baz/captures/123" do
99
101
  get "/baz/redirect_with_captures/123"
100
- should redirect_to("/baz/captures/123")
102
+ is_expected.to redirect_to("/baz/captures/123")
101
103
  end
102
104
 
103
105
  it "should fail if does not redirect" do
104
106
  get "/baz/captures/123"
105
- should_not redirect_to("/baz/captures/123")
107
+ is_expected.not_to redirect_to("/baz/captures/123")
106
108
  end
107
109
  end
108
110
 
109
111
  context "with absolute URI" do
110
112
  it "redirects to http://example.com" do
111
- get "/cushion", :q => "http://example.com"
112
- should redirect_to("http://example.com")
113
+ get "/cushion", q: "http://example.com"
114
+ is_expected.to redirect_to("http://example.com")
113
115
  end
114
116
 
115
117
  it "redirects to ftp://example.com" do
116
- get "/cushion", :q => "ftp://example.com"
117
- should redirect_to("ftp://example.com")
118
+ get "/cushion", q: "ftp://example.com"
119
+ is_expected.to redirect_to("ftp://example.com")
118
120
  end
119
121
  end
120
122
  end
@@ -14,7 +14,7 @@ class TestApp < Padrino::Application
14
14
  "foo"
15
15
  end
16
16
 
17
- get :show, :with => :id do
17
+ get :show, with: :id do
18
18
  "foo"
19
19
  end
20
20
 
@@ -45,11 +45,11 @@ class TestApp < Padrino::Application
45
45
  "show"
46
46
  end
47
47
 
48
- get :redirect_with_captures, :with => :id do |id|
49
- redirect url(:baz, :captures, :id => id)
48
+ get :redirect_with_captures, with: :id do |id|
49
+ redirect url(:baz, :captures, id: id)
50
50
  end
51
51
 
52
- get :captures, :with => :id do |id|
52
+ get :captures, with: :id do |id|
53
53
  "with #{id}"
54
54
  end
55
55
  end
@@ -2,14 +2,14 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
3
  describe RSpec::Padrino do
4
4
  it "can be included" do
5
- lambda { include RSpec::Padrino }.should_not raise_error
5
+ expect { include RSpec::Padrino }.not_to raise_error
6
6
  end
7
7
 
8
8
  it "includes RSpec::Padrino::* automatically" do
9
9
  module Foo
10
10
  include RSpec::Padrino
11
11
  end
12
- Foo.should be_include(RSpec::Padrino::Methods)
13
- Foo.should be_include(RSpec::Padrino::Matchers)
12
+ expect(Foo).to be_include(RSpec::Padrino::Methods)
13
+ expect(Foo).to be_include(RSpec::Padrino::Matchers)
14
14
  end
15
15
  end
@@ -5,16 +5,16 @@ require 'pry'
5
5
  describe RSpec::Padrino::Methods do
6
6
  describe "#app_helpers" do
7
7
  subject { app_helpers(TestApp) }
8
- it { should respond_to :url_for }
8
+ it { is_expected.to respond_to :url_for }
9
9
 
10
10
  it "should render content tag" do
11
- subject.content_tag(:div, "foo").
12
- should == "<div>foo</div>"
11
+ expect(subject.content_tag(:div, "foo")).
12
+ to eq("<div>foo</div>")
13
13
  end
14
14
 
15
15
  it "should respond to a custom helper" do
16
- subject.foo_index_path.
17
- should == "/foo"
16
+ expect(subject.foo_index_path).
17
+ to eq("/foo")
18
18
  end
19
19
  end
20
20
  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.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio KONDO
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.13.0
33
+ version: 0.13.3.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.13.0
40
+ version: 0.13.3.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.13.0
75
+ version: 0.13.3.1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 0.13.0
82
+ version: 0.13.3.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rdoc
85
85
  requirement: !ruby/object:Gem::Requirement