rspeckled 0.0.2 → 0.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rspeckled/helpers.rb +2 -1
- data/lib/rspeckled/helpers/patterns.rb +33 -0
- data/lib/rspeckled/helpers/responses.rb +6 -0
- data/lib/rspeckled/plugins.rb +1 -0
- data/lib/rspeckled/plugins/authentication.rb +2 -2
- data/lib/rspeckled/plugins/awesome_print.rb +32 -0
- data/lib/rspeckled/plugins/email.rb +9 -4
- data/lib/rspeckled/plugins/shoulda.rb +6 -3
- data/lib/rspeckled/version.rb +1 -1
- metadata +5 -4
- metadata.gz.sig +3 -2
- data/lib/rspeckled/helpers/session_helpers.rb +0 -5
- data/lib/rspeckled/support/misc.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98403eadd91a6ec563587a4949c4632573c29e3f
|
4
|
+
data.tar.gz: 7ec2e31f96d027e8760f4294185c9583036d496e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b19ececf090c791f094ac62744dfe1327aaa2d39c5e993496167c81ee2b70fb4e3b3c7875d61a636683335aaf22fc5adceb3c6d97e4011dd7f23f389574d407
|
7
|
+
data.tar.gz: 4887881a25f933d78aabcd88262fb901e7769b1fb69358e9b5c129ddad5dc7469835c8cfd431cf38b9dd17afa2dd49c3c492ac177034f6400129075ec3459b8f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rspeckled/helpers.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
def uuid_regex
|
3
|
+
/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/
|
4
|
+
end
|
5
|
+
|
6
|
+
def guid_regex
|
7
|
+
/[a-f0-9]{32}/
|
8
|
+
end
|
9
|
+
|
10
|
+
def sha_regex
|
11
|
+
/[a-f0-9]{64}/
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_email_regex
|
15
|
+
/user\d+@example.com/
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_username_regex
|
19
|
+
/username\d+/
|
20
|
+
end
|
21
|
+
|
22
|
+
def json_web_token_base64_regex
|
23
|
+
%r{[A-Za-z0-9_/\+\=\-]}
|
24
|
+
end
|
25
|
+
|
26
|
+
def json_web_token_regex
|
27
|
+
/
|
28
|
+
\A
|
29
|
+
(#{json_web_token_base64_regex}+?\.){4}
|
30
|
+
#{json_web_token_base64_regex}+?
|
31
|
+
\z
|
32
|
+
/x
|
33
|
+
end
|
data/lib/rspeckled/plugins.rb
CHANGED
@@ -23,7 +23,7 @@ RSpec.configure do |config|
|
|
23
23
|
downcase
|
24
24
|
|
25
25
|
current_class_method = if options.is_a?(Hash) && options[:method]
|
26
|
-
options[:method]
|
26
|
+
options[:method] || :current_user
|
27
27
|
else
|
28
28
|
:"current_#{underscored_class_name}"
|
29
29
|
end
|
@@ -86,7 +86,7 @@ RSpec.configure do |config|
|
|
86
86
|
'iat' => Time.now.utc.to_i,
|
87
87
|
'jti' => SecureRandom.uuid,
|
88
88
|
'sid' => instance['account_id'] || instance['id'],
|
89
|
-
'rol' => options[:
|
89
|
+
'rol' => options[:roles] || 'standard',
|
90
90
|
},
|
91
91
|
{
|
92
92
|
'typ' => 'JWT',
|
@@ -0,0 +1,32 @@
|
|
1
|
+
##############################################################################
|
2
|
+
# Awesome Print Plugin
|
3
|
+
##############################################################################
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'awesome_print'
|
7
|
+
|
8
|
+
module Kernel
|
9
|
+
def sap(msg)
|
10
|
+
puts
|
11
|
+
puts
|
12
|
+
ap "************************** #{Time.now} **************************", :color => { :string => :white }
|
13
|
+
puts
|
14
|
+
ap(msg.class, :color => { :class => :yellowish }) if msg.respond_to?(:class)
|
15
|
+
puts
|
16
|
+
root_path = defined?(Rails) ? Rails.root.to_s : ''
|
17
|
+
|
18
|
+
lines = caller[0...3].map do |line|
|
19
|
+
line.gsub(root_path + '/', '')
|
20
|
+
end
|
21
|
+
|
22
|
+
lines.each { |line| ap line, :color => { :string => :purpleish } }
|
23
|
+
puts
|
24
|
+
ap msg
|
25
|
+
puts
|
26
|
+
ap '************************************* END **************************************', :color => { :string => :white }
|
27
|
+
puts
|
28
|
+
puts
|
29
|
+
end
|
30
|
+
end
|
31
|
+
rescue LoadError
|
32
|
+
end
|
@@ -12,16 +12,21 @@ begin
|
|
12
12
|
require 'email_spec'
|
13
13
|
|
14
14
|
RSpec.configure do |config|
|
15
|
-
config.include EmailSpec::Helpers,
|
16
|
-
config.include EmailSpec::Matchers,
|
15
|
+
config.include EmailSpec::Helpers, :email => true
|
16
|
+
config.include EmailSpec::Matchers, :email => true
|
17
|
+
config.include EmailSpec::MailerDeliveries, :email => true
|
17
18
|
end
|
18
19
|
rescue LoadError
|
19
20
|
end
|
20
21
|
|
21
22
|
if defined? ActionMailer
|
22
23
|
RSpec.configure do |config|
|
23
|
-
config.
|
24
|
-
ActionMailer::Base.
|
24
|
+
config.before(:each, :email => true) do
|
25
|
+
if defined?(ActionMailer) && ActionMailer::Base.delivery_method == :cache
|
26
|
+
mailer.clear_cache
|
27
|
+
else
|
28
|
+
deliveries.clear
|
29
|
+
end
|
25
30
|
end
|
26
31
|
end
|
27
32
|
end
|
@@ -4,10 +4,12 @@
|
|
4
4
|
|
5
5
|
begin
|
6
6
|
require 'shoulda-matchers'
|
7
|
-
rescue LoadError
|
8
|
-
end
|
9
7
|
|
10
|
-
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.include(Shoulda::Matchers::ActiveModel, :type => :model)
|
10
|
+
config.include(Shoulda::Matchers::ActiveRecord, :type => :model)
|
11
|
+
end
|
12
|
+
|
11
13
|
Shoulda::Matchers.configure do |config|
|
12
14
|
config.integrate do |with|
|
13
15
|
with.test_framework :rspec
|
@@ -37,4 +39,5 @@ if defined? Shoulda
|
|
37
39
|
end
|
38
40
|
end
|
39
41
|
end
|
42
|
+
rescue LoadError
|
40
43
|
end
|
data/lib/rspeckled/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspeckled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thegranddesign
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
zRIv8lqQM8QFT76rzP5SBCERwN+ltKAFbQ5/FwmZNGWYnmCP3RZMQiRnbh+9H9lh
|
32
32
|
mlbwaYZTjgsXq6cy8N38EecewgBbZYS1IYJraE/M
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-05-
|
34
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
@@ -89,13 +89,15 @@ files:
|
|
89
89
|
- lib/rspeckled/helpers.rb
|
90
90
|
- lib/rspeckled/helpers/factories.rb
|
91
91
|
- lib/rspeckled/helpers/null_objects.rb
|
92
|
-
- lib/rspeckled/helpers/
|
92
|
+
- lib/rspeckled/helpers/patterns.rb
|
93
|
+
- lib/rspeckled/helpers/responses.rb
|
93
94
|
- lib/rspeckled/mock_authentications/omniauth.rb
|
94
95
|
- lib/rspeckled/mock_authentications/omniauth/ebay.rb
|
95
96
|
- lib/rspeckled/mock_authentications/omniauth/facebook.rb
|
96
97
|
- lib/rspeckled/mock_authentications/omniauth/twitter.rb
|
97
98
|
- lib/rspeckled/plugins.rb
|
98
99
|
- lib/rspeckled/plugins/authentication.rb
|
100
|
+
- lib/rspeckled/plugins/awesome_print.rb
|
99
101
|
- lib/rspeckled/plugins/bullet.rb
|
100
102
|
- lib/rspeckled/plugins/carrier_wave.rb
|
101
103
|
- lib/rspeckled/plugins/code_climate.rb
|
@@ -133,7 +135,6 @@ files:
|
|
133
135
|
- lib/rspeckled/support/garbage_collection.rb
|
134
136
|
- lib/rspeckled/support/heroku.rb
|
135
137
|
- lib/rspeckled/support/i18n.rb
|
136
|
-
- lib/rspeckled/support/misc.rb
|
137
138
|
- lib/rspeckled/support/mocks.rb
|
138
139
|
- lib/rspeckled/support/output.rb
|
139
140
|
- lib/rspeckled/support/pending.rb
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
���W��F������mW�/�Ң�
|
2
|
+
�������N$@�o3E��1�Tu ��P�#�/�Dq&��{�T���fT eK�B�ژM���&!�A��ee҂�-�Y]3��1 #ێ�e�х��
|
3
|
+
��}������F#O���d<4mA�B�ܧ:���y�&�a�h4���\ɝ��bֶEn˓�(��ly��g�|�5`C����!�.?Y<F�w�tA��)8��?{18-�]�Cr��%��n�sί$�d�1#
|
@@ -1 +0,0 @@
|
|
1
|
-
RSpec.configure(&:disable_monkey_patching!)
|