rspectacular 0.31.0 → 0.33.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: ae8296d314dc3f827b91c8a70432ad65b9eda16b
4
- data.tar.gz: 314ce8040adf0cbfb09b6f8a066d0fc68867e576
3
+ metadata.gz: c39dc3124b03d348faed3eb85ec3145aa9901098
4
+ data.tar.gz: 5cb73fca23dd2258a076ddc377a5491f05730c5f
5
5
  SHA512:
6
- metadata.gz: 738b3cf2116e24aa16dc182a5fa6136c7634b1e37f4dea16b4a9c71f3fd93440973e2791372f6ca2a603f3bd4caea90f2175b4537f2402078731d87dcbdbada8
7
- data.tar.gz: 19d6d07abe7cb82aea9b384a50161be4012a41af8cfd167ba6e7f5dea14556e9d61f5ed2973f45c74a55549dea9ffbcf00d895d89be744ec7f04ccdf744ff08f
6
+ metadata.gz: 97b509744a6deb2cdd9d1b922a690829dd236a963cb77effc6f964acc6a8db2f33e010736abcc94da9c50bfb1fe87d6a16bb02f6fcabd3166902c54cd0735ec4
7
+ data.tar.gz: 062d5700d2075ef571975963ec361fd4fcb24bb7db1847328ead4e17241ed820fc45a3b8004a623809465f3fb792d84b070efb0df12e5c6adb8cda70a2e67942
@@ -0,0 +1,24 @@
1
+ module OmniAuth
2
+ module MockAuthentications
3
+ module Ebay
4
+ def self.authentication
5
+ OmniAuth::AuthHash.new(
6
+ 'provider' => 'ebay',
7
+ 'uid' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
8
+ 'info' =>
9
+ {
10
+ 'ebay_id' => 'my_username',
11
+ 'ebay_token' => 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
12
+ 'email' => 'username@example.com',
13
+ 'full_name' => 'Gorby Thunderhorse',
14
+ 'country' => 'US'
15
+ },
16
+ 'credentials' => {},
17
+ 'extra' => {
18
+ 'internal_return_to' => nil
19
+ }
20
+ )
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,8 +1,8 @@
1
1
  module OmniAuth
2
+ module MockAuthentications
2
3
  module Facebook
3
- module MockAuthentication
4
- def self.user
5
- {
4
+ def self.authentication
5
+ OmniAuth::AuthHash.new(
6
6
  'provider' => 'facebook',
7
7
  'uid' => '100002971692646',
8
8
  'credentials' => {
@@ -36,7 +36,7 @@ module MockAuthentication
36
36
  'updated_time' => '2011-09-11T17:00:51+0000'
37
37
  }
38
38
  }
39
- }
39
+ )
40
40
  end
41
41
  end
42
42
  end
@@ -1,8 +1,8 @@
1
1
  module OmniAuth
2
+ module MockAuthentications
2
3
  module Twitter
3
- module MockAuthentication
4
- def self.user
5
- {
4
+ def self.authentication
5
+ OmniAuth::AuthHash.new(
6
6
  'provider' => 'twitter',
7
7
  'uid' => '100002971692646',
8
8
  'credentials' => {
@@ -36,7 +36,7 @@ module MockAuthentication
36
36
  'updated_time' => '2011-09-11T17:00:51+0000'
37
37
  }
38
38
  }
39
- }
39
+ )
40
40
  end
41
41
  end
42
42
  end
@@ -1,18 +1,3 @@
1
- require 'rspectacular/plugins/capybara.rb'
2
- require 'rspectacular/plugins/carrier_wave.rb'
3
- require 'rspectacular/plugins/database_cleaner.rb'
4
- require 'rspectacular/plugins/devise.rb'
5
- require 'rspectacular/plugins/email.rb'
6
- require 'rspectacular/plugins/factory_girl.rb'
7
- require 'rspectacular/plugins/features.rb'
8
- require 'rspectacular/plugins/omniauth.rb'
9
- require 'rspectacular/plugins/paypal.rb'
10
- require 'rspectacular/plugins/rails/engine.rb'
11
- require 'rspectacular/plugins/recaptcha.rb'
12
- require 'rspectacular/plugins/shoulda.rb'
13
- require 'rspectacular/plugins/sidekiq.rb'
14
- require 'rspectacular/plugins/singleton.rb'
15
- require 'rspectacular/plugins/stripe.rb'
16
- require 'rspectacular/plugins/timecop.rb'
17
- require 'rspectacular/plugins/vcr.rb'
18
- require 'rspectacular/plugins/webmock.rb'
1
+ Dir[File.expand_path('../plugins/**/*.rb', __FILE__)].
2
+ reject { |filename| filename.match /(code_climate|simple_cov)\.rb\z/ }.
3
+ each { |filename| require filename }
@@ -11,8 +11,9 @@ begin
11
11
  #
12
12
  OmniAuth.configure do |config|
13
13
  config.test_mode = true
14
- config.mock_auth[:facebook] = OmniAuth::Facebook::MockAuthentication.user
15
- config.mock_auth[:twitter] = OmniAuth::Twitter::MockAuthentication.user
14
+ config.mock_auth[:facebook] = OmniAuth::MockAuthentications::Facebook.authentication
15
+ config.mock_auth[:twitter] = OmniAuth::MockAuthentications::Twitter.authentication
16
+ config.mock_auth[:ebay] = OmniAuth::MockAuthentications::Ebay.authentication
16
17
  end
17
18
 
18
19
  ###
@@ -23,10 +24,22 @@ begin
23
24
  previous_omniauth_test_mode = OmniAuth.config.test_mode
24
25
  OmniAuth.config.test_mode = false
25
26
 
27
+ example.metadata.fetch(:mock_auth, {}).each do |auth_type, auth_hash|
28
+ OmniAuth.config.add_mock(auth_type, auth_hash)
29
+ end
30
+
26
31
  example.run
27
32
 
28
33
  OmniAuth.config.test_mode = previous_omniauth_test_mode
29
34
  end
35
+
36
+ config.before(:each, type: :controller, mock_auth: lambda { |v| !!v }) do |example|
37
+ if example.metadata[:mock_auth].is_a? Symbol
38
+ request.env['omniauth.auth'] = OmniAuth.config.mock_auth[example.metadata[:mock_auth]]
39
+ else
40
+ request.env['omniauth.auth'] = OmniAuth::AuthHash.new(example.metadata[:mock_auth])
41
+ end
42
+ end
30
43
  end
31
44
  rescue LoadError
32
45
  end
@@ -0,0 +1,21 @@
1
+ ##############################################################################
2
+ # Referehencible Plugin
3
+ ##############################################################################
4
+
5
+ begin
6
+ require 'referehencible'
7
+
8
+ RSpec.configure do |config|
9
+ config.before(:each, :mock_refs => lambda { |v| !!v }) do |example|
10
+ reference = if example.metadata[:mock_refs].is_a? TrueClass
11
+ 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
12
+ else
13
+ example.metadata[:mock_refs]
14
+ end
15
+
16
+ allow(Referehencible).to receive(:reference_number).
17
+ and_return(reference)
18
+ end
19
+ end
20
+ rescue LoadError
21
+ end
@@ -1,3 +1,3 @@
1
1
  module RSpectacular
2
- VERSION = '0.31.0'
2
+ VERSION = '0.33.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspectacular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jfelchner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-30 00:00:00.000000000 Z
11
+ date: 2014-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -69,6 +69,7 @@ files:
69
69
  - lib/rspectacular/matchers/active_record/truthfulness_matcher.rb
70
70
  - lib/rspectacular/matchers/authentication.rb
71
71
  - lib/rspectacular/mock_authentications/omniauth.rb
72
+ - lib/rspectacular/mock_authentications/omniauth/ebay.rb
72
73
  - lib/rspectacular/mock_authentications/omniauth/facebook.rb
73
74
  - lib/rspectacular/mock_authentications/omniauth/twitter.rb
74
75
  - lib/rspectacular/plugins.rb
@@ -85,6 +86,7 @@ files:
85
86
  - lib/rspectacular/plugins/paypal.rb
86
87
  - lib/rspectacular/plugins/rails/engine.rb
87
88
  - lib/rspectacular/plugins/recaptcha.rb
89
+ - lib/rspectacular/plugins/referehencible.rb
88
90
  - lib/rspectacular/plugins/shoulda.rb
89
91
  - lib/rspectacular/plugins/sidekiq.rb
90
92
  - lib/rspectacular/plugins/simple_cov.rb