Commit 0e4138c5 authored by Jose Ernesto Suarez's avatar Jose Ernesto Suarez

PAsamos los tests de configuracion

parent 12742e38
example_id | status | run_time |
----------------------------- | ------ | --------------- |
./spec/zoholib_spec.rb[1:1] | passed | 0.00183 seconds |
./spec/zoholib_spec.rb[1:2] | passed | 0.00144 seconds |
./spec/zoholib_spec.rb[1:3:1] | passed | 0.00112 seconds |
./spec/zoholib_spec.rb[1:3:2] | passed | 0.0012 seconds |
./spec/zoholib_spec.rb[1:3:3] | passed | 0.00009 seconds |
./spec/zoholib_spec.rb[1:3:4] | passed | 0.0002 seconds |
./spec/zoholib_spec.rb[1:3:5] | passed | 0.00022 seconds |
...@@ -20,7 +20,6 @@ module Zoholib ...@@ -20,7 +20,6 @@ module Zoholib
end end
def self.configuration def self.configuration
puts "Init connfig"
@configuration ||= Configuration.new @configuration ||= Configuration.new
end end
...@@ -29,7 +28,6 @@ module Zoholib ...@@ -29,7 +28,6 @@ module Zoholib
end end
def self.configure def self.configure
puts "configuring"
yield(configuration) yield(configuration)
end end
end end
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
module Zoholib module Zoholib
## ##
# This class permits the configuration of the Zoholib # This class permits the configuration of the Valenciaport Access.
# 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 class Configuration
attr_accessor :client_id, :client_secret, :scope, :refresh_token attr_accessor :client_id, :client_secret, :scope, :refresh_token
def initialize def initialize
@client_id = nil @client_id = nil
@client_secret = nil @client_secret = nil
......
...@@ -6,6 +6,7 @@ require 'zoholib' ...@@ -6,6 +6,7 @@ require 'zoholib'
RSpec.configure do |conf| RSpec.configure do |conf|
conf.before(:all) do conf.before(:all) do
Zoholib.configure do |config| Zoholib.configure do |config|
puts "Trying to config"
config.client_id = "client_id" config.client_id = "client_id"
config.client_secret = "client_secret" config.client_secret = "client_secret"
config.scope = "scope" config.scope = "scope"
......
require './lib/zoholib' require 'spec_helper'
require 'stringio'
RSpec.describe Zoholib do RSpec.describe Zoholib do
it 'has a version number' do it 'has a version number' do
...@@ -23,7 +24,7 @@ RSpec.describe Zoholib do ...@@ -23,7 +24,7 @@ RSpec.describe Zoholib do
end end
it 'The scopes is a string' do it 'The scopes is a string' do
expect(Zoholib.configuration.scopes).to be_an(String) expect(Zoholib.configuration.scope).to be_an(String)
end end
it 'The refresh_token is a string' do it 'The refresh_token is a string' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment