Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
google-wedoops
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gems
google-wedoops
Commits
bee8ceec
Commit
bee8ceec
authored
Apr 29, 2020
by
Jose Ernesto Suarez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Se ajustan los test para probar las clases
parent
7ede1e96
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
13 deletions
+50
-13
.rspec_status
.rspec_status
+10
-7
configuration.rb
lib/google-wedoops/configuration.rb
+4
-1
credentials.json
spec/credentials.json
+12
-0
google-wedoops_spec.rb
spec/google-wedoops_spec.rb
+16
-4
spec_helper.rb
spec/spec_helper.rb
+8
-1
No files found.
.rspec_status
View file @
bee8ceec
example_id | status | run_time |
------------------------------------ | ------ | --------------- |
./spec/google-wedoops_spec.rb[1:1] | passed | 0.00118 seconds |
./spec/google-wedoops_spec.rb[1:2] | passed | 0.00102 seconds |
./spec/google-wedoops_spec.rb[1:3:1] | passed | 0.00062 seconds |
./spec/google-wedoops_spec.rb[1:3:2] | passed | 0.00006 seconds |
./spec/google-wedoops_spec.rb[1:4:1] | failed | 0.00007 seconds |
./spec/google-wedoops_spec.rb[1:4:2] | failed | 0.00009 seconds |
./spec/google-wedoops_spec.rb[1:4:3] | failed | 0.00007 seconds |
./spec/google-wedoops_spec.rb[1:1] | passed | 0.00046 seconds |
./spec/google-wedoops_spec.rb[1:2] | passed | 0.00034 seconds |
./spec/google-wedoops_spec.rb[1:3:1] | passed | 0.0006 seconds |
./spec/google-wedoops_spec.rb[1:3:2] | passed | 0.0001 seconds |
./spec/google-wedoops_spec.rb[1:3:3] | passed | 0.00007 seconds |
./spec/google-wedoops_spec.rb[1:3:4] | passed | 0.00008 seconds |
./spec/google-wedoops_spec.rb[1:3:5] | passed | 0.00004 seconds |
./spec/google-wedoops_spec.rb[1:4:1] | passed | 0.00008 seconds |
./spec/google-wedoops_spec.rb[1:4:2] | passed | 0.00018 seconds |
./spec/google-wedoops_spec.rb[1:4:3] | passed | 0.00012 seconds |
lib/google-wedoops/configuration.rb
View file @
bee8ceec
...
...
@@ -6,10 +6,13 @@ module Wedoops
# Is neccesary the WDSL URLs for the login and transport endpoint
# as well the array with the different credentials wich will be used
class
Configuration
attr_accessor
:user
attr_accessor
:user
,
:scopes
,
:user_impersonate
,
:credentials
def
initialize
@user
=
nil
@scopes
=
nil
@user_impersonate
=
nil
@credentials
=
nil
end
...
...
spec/credentials.json
0 → 100644
View file @
bee8ceec
{
"type"
:
"service_account"
,
"project_id"
:
"-"
,
"private_key_id"
:
"-"
,
"private_key"
:
"-"
,
"client_email"
:
"-"
,
"client_id"
:
"-"
,
"auth_uri"
:
"https://accounts.google.com/o/oauth2/auth"
,
"token_uri"
:
"https://oauth2.googleapis.com/token"
,
"auth_provider_x509_cert_url"
:
"https://www.googleapis.com/oauth2/v1/certs"
,
"client_x509_cert_url"
:
"-"
}
\ No newline at end of file
spec/google-wedoops_spec.rb
View file @
bee8ceec
require
'spec_helper'
require
'stringio'
def
authentication
Wedoops
::
Google
::
Authenticator
.
new
(
Wedoops
::
Google
.
configuration
.
credentials
,
Wedoops
::
Google
.
configuration
.
scopes
)
end
RSpec
.
describe
Wedoops
::
Google
do
it
'has a version number'
do
expect
(
Wedoops
::
Google
::
VERSION
).
not_to
be
nil
...
...
@@ -18,20 +22,28 @@ RSpec.describe Wedoops::Google do
it
'The user is a string'
do
expect
(
Wedoops
::
Google
.
configuration
.
user
).
to
be_an
(
String
)
end
it
'The scopes are an Array'
do
expect
(
Wedoops
::
Google
.
configuration
.
scopes
).
to
be_an
(
Array
)
end
it
'The credentials is a string'
do
expect
(
Wedoops
::
Google
.
configuration
.
credentials
).
to
be_an
(
String
)
end
it
'The user_impersonate is a valid email'
do
expect
(
Wedoops
::
Google
.
configuration
.
user_impersonate
).
to
be_an
(
String
)
end
end
describe
'Components'
do
it
'El authenticator es un Wedoops::Google::Autenticator'
do
expect
(
Wedoops
::
Google
::
Aut
enticator
.
new
).
to
be_a_kind_of
(
Wedoops
::
Google
::
Aut
enticator
)
expect
(
Wedoops
::
Google
::
Aut
henticator
.
new
(
Wedoops
::
Google
.
configuration
.
credentials
,
Wedoops
::
Google
.
configuration
.
scopes
)).
to
be_a_kind_of
(
Wedoops
::
Google
::
Auth
enticator
)
end
it
'El Drive es un Wedoops::Google::Drive'
do
expect
(
Wedoops
::
Google
::
Drive
.
new
).
to
be_a_kind_of
(
Wedoops
::
Google
::
Drive
)
expect
(
Wedoops
::
Google
::
Drive
.
new
(
authentication
)
).
to
be_a_kind_of
(
Wedoops
::
Google
::
Drive
)
end
it
'El Reseller es un Wedoops::Google::Reseller'
do
expect
(
Wedoops
::
Google
::
Reseller
.
new
).
to
be_a_kind_of
(
Wedoops
::
Google
::
Reseller
)
expect
(
Wedoops
::
Google
::
Reseller
.
new
(
authentication
)
).
to
be_a_kind_of
(
Wedoops
::
Google
::
Reseller
)
end
...
...
spec/spec_helper.rb
View file @
bee8ceec
...
...
@@ -7,7 +7,14 @@ RSpec.configure do |conf|
conf
.
before
(
:all
)
do
Wedoops
::
Google
.
configure
do
|
config
|
puts
"Trying to config"
config
.
user
=
"Pepito"
config
.
user
=
"pepito"
config
.
credentials
=
"./spec/credentials.json"
config
.
scopes
=
[
"https://www.googleapis.com/auth/apps.order"
,
"https://www.googleapis.com/auth/admin.directory.user"
,
"https://www.googleapis.com/auth/siteverification"
,
"https://www.googleapis.com/auth/gmail.readonly"
,
"https://www.googleapis.com/auth/drive"
]
config
.
user_impersonate
=
"ernesto@appsimplantadores.com"
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment