ordino_sdk 0.0.6
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 +7 -0
- data/.gitignore +18 -0
- data/.travis.yml +5 -0
- data/CHANGELOG.md +17 -0
- data/CONTRIBUTING.md +30 -0
- data/Gemfile +4 -0
- data/LICENCE.md +617 -0
- data/README.md +72 -0
- data/Rakefile +8 -0
- data/lib/ordino_sdk/configuration.rb +43 -0
- data/lib/ordino_sdk/email_shortcodes.rb +6 -0
- data/lib/ordino_sdk/helpers.rb +27 -0
- data/lib/ordino_sdk/mocker.rb +72 -0
- data/lib/ordino_sdk/resource.rb +26 -0
- data/lib/ordino_sdk/resources/entry.rb +26 -0
- data/lib/ordino_sdk/resources/user.rb +15 -0
- data/lib/ordino_sdk/resources/web_page.rb +27 -0
- data/lib/ordino_sdk/version.rb +3 -0
- data/lib/ordino_sdk.rb +25 -0
- data/ordino_sdk.gemspec +29 -0
- data/test/arbitary_test.rb +9 -0
- data/test/configuration_test.rb +51 -0
- data/test/mocker_test.rb +35 -0
- data/test/resource_test.rb +30 -0
- data/test/resources/entry_test.rb +20 -0
- data/test/resources/user_test.rb +10 -0
- data/test/resources/web_page_test.rb +15 -0
- data/test/test_helper.rb +29 -0
- metadata +177 -0
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# Ordino SDK
|
2
|
+
|
3
|
+
[](https://travis-ci.org/meducation/ordino_sdk)
|
4
|
+
[](https://gemnasium.com/meducation/ordino_sdk)
|
5
|
+
[](https://codeclimate.com/github/meducation/ordino_sdk)
|
6
|
+
|
7
|
+
A wrapper for Ordino's SDK.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'ordino_sdk'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Resources accept the following methods:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
OrdinoSDK::MediaFile.find(id)
|
27
|
+
OrdinoSDK::MediaFile.find_each #=> do ... end
|
28
|
+
OrdinoSDK::MediaFile.where(foo: 'bar') #=> []
|
29
|
+
OrdinoSDK::MediaFile.where(foo: 'bar').select([:id, :name]) #=> []
|
30
|
+
OrdinoSDK::MediaFile.create(foo: 'bar')
|
31
|
+
```
|
32
|
+
|
33
|
+
The following objects are currently supported:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
User
|
37
|
+
```
|
38
|
+
|
39
|
+
### Is it any good?
|
40
|
+
|
41
|
+
[Yes.](http://news.ycombinator.com/item?id=3067434)
|
42
|
+
|
43
|
+
## Contributing
|
44
|
+
|
45
|
+
Firstly, thank you!! :heart::sparkling_heart::heart:
|
46
|
+
|
47
|
+
We'd love to have you involved. Please read our [contributing guide](https://github.com/meducation/propono/tree/master/CONTRIBUTING.md) for information on how to get stuck in.
|
48
|
+
|
49
|
+
### Contributors
|
50
|
+
|
51
|
+
This project is managed by the [Meducation team](http://company.meducation.net/about#team).
|
52
|
+
|
53
|
+
These individuals have come up with the ideas and written the code that made this possible:
|
54
|
+
|
55
|
+
- [Jeremy Walker](http://github.com/iHID)
|
56
|
+
|
57
|
+
## Licence
|
58
|
+
|
59
|
+
Copyright (C) 2013 New Media Education Ltd
|
60
|
+
|
61
|
+
This program is free software: you can redistribute it and/or modify
|
62
|
+
it under the terms of the GNU Affero General Public License as published by
|
63
|
+
the Free Software Foundation, either version 3 of the License, or
|
64
|
+
(at your option) any later version.
|
65
|
+
|
66
|
+
This program is distributed in the hope that it will be useful,
|
67
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
68
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
69
|
+
GNU Affero General Public License for more details.
|
70
|
+
|
71
|
+
A copy of the GNU Affero General Public License is available in [Licence.md](https://github.com/meducation/propono/blob/master/LICENCE.md)
|
72
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
data/Rakefile
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
module OrdinoSDK
|
2
|
+
class OrdinoSDKError < StandardError
|
3
|
+
end
|
4
|
+
class OrdinoSDKConfigurationError < OrdinoSDKError
|
5
|
+
end
|
6
|
+
|
7
|
+
class Configuration
|
8
|
+
|
9
|
+
SETTINGS = [
|
10
|
+
:logger
|
11
|
+
]
|
12
|
+
|
13
|
+
attr_writer *SETTINGS
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
self.logger = Filum.logger
|
17
|
+
end
|
18
|
+
|
19
|
+
[:access_id, :secret_key, :endpoint, :cache].each do |setting|
|
20
|
+
define_method "#{setting}=" do |val|
|
21
|
+
Loquor.config.send("#{setting}=", val)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def logger=(val)
|
26
|
+
@logger = val
|
27
|
+
Loquor.config.logger = val
|
28
|
+
end
|
29
|
+
|
30
|
+
SETTINGS.each do |setting|
|
31
|
+
define_method setting do
|
32
|
+
get_or_raise(setting)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def get_or_raise(setting)
|
39
|
+
instance_variable_get("@#{setting.to_s}") ||
|
40
|
+
raise(OrdinoSDKConfigurationError.new("Configuration for #{setting} is not set"))
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module OrdinoSDK
|
2
|
+
module Helpers
|
3
|
+
SDK_TO_SPI_MAPPINGS = {}
|
4
|
+
|
5
|
+
def sdk_class_for(spi_type)
|
6
|
+
sdk_type_for(spi_type).constantize
|
7
|
+
end
|
8
|
+
|
9
|
+
def sdk_type_for(spi_type)
|
10
|
+
if SDK_TO_SPI_MAPPINGS.has_value?(spi_type)
|
11
|
+
SDK_TO_SPI_MAPPINGS.key(spi_type)
|
12
|
+
else
|
13
|
+
"OrdinoSDK::#{spi_type.gsub("::", "")}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def spi_type_for(sdk_type)
|
18
|
+
sdk_type = sdk_type.gsub(/Mock$/, "")
|
19
|
+
if SDK_TO_SPI_MAPPINGS.has_key?(sdk_type)
|
20
|
+
SDK_TO_SPI_MAPPINGS[sdk_type]
|
21
|
+
else
|
22
|
+
sdk_type.gsub("OrdinoSDK::", "")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
module OrdinoSDK
|
2
|
+
class Mocker
|
3
|
+
def self.mock!
|
4
|
+
RESOURCES.each do |resource|
|
5
|
+
new(resource).mock!
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.unmock!
|
10
|
+
RESOURCES.each do |resource|
|
11
|
+
new(resource).unmock!
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def initialize(resource_name)
|
16
|
+
@resource_name = resource_name
|
17
|
+
end
|
18
|
+
|
19
|
+
def mock!
|
20
|
+
return if mock_module.const_defined?(original_class_name)
|
21
|
+
|
22
|
+
resource = "#{mock_module_name}::#{resource_class_name}".constantize
|
23
|
+
mock = "#{mock_module_name}::#{mock_class_name}".constantize
|
24
|
+
|
25
|
+
mock_module.const_set(original_class_name, resource)
|
26
|
+
mock_module.send(:remove_const, resource_class_name)
|
27
|
+
mock_module.const_set(resource_class_name, mock)
|
28
|
+
mock_module.send(:remove_const, mock_class_name)
|
29
|
+
end
|
30
|
+
|
31
|
+
def unmock!
|
32
|
+
return unless mock_module.const_defined?(original_class_name)
|
33
|
+
|
34
|
+
original = "#{mock_module_name}::#{original_class_name}".constantize
|
35
|
+
resource = "#{mock_module_name}::#{resource_class_name}".constantize
|
36
|
+
|
37
|
+
mock_module.const_set(mock_class_name, resource)
|
38
|
+
mock_module.send(:remove_const, resource_class_name)
|
39
|
+
mock_module.const_set(resource_class_name, original)
|
40
|
+
mock_module.send(:remove_const, original_class_name)
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
def resource_class_name
|
45
|
+
@resource_class_name ||= @resource_name.camelize.split("::").last
|
46
|
+
end
|
47
|
+
|
48
|
+
def mock_class_name
|
49
|
+
@mock_class_name ||= "#{@resource_name}_mock".camelize.split("::").last
|
50
|
+
end
|
51
|
+
|
52
|
+
def original_class_name
|
53
|
+
@original_class_name ||= "#{@resource_name}_original".camelize.split("::").last
|
54
|
+
end
|
55
|
+
|
56
|
+
def mock_module
|
57
|
+
@mock_module ||= mock_module_name.constantize
|
58
|
+
end
|
59
|
+
|
60
|
+
def mock_module_name
|
61
|
+
@mock_module_name ||= begin
|
62
|
+
parts = @resource_name.camelize.split("::")
|
63
|
+
if parts.size == 1
|
64
|
+
"OrdinoSDK"
|
65
|
+
else
|
66
|
+
parts.pop
|
67
|
+
"OrdinoSDK::#{parts.join("::")}"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module OrdinoSDK
|
2
|
+
class Resource < Loquor::Resource
|
3
|
+
include Helpers
|
4
|
+
|
5
|
+
def self.spi_type=(type)
|
6
|
+
Helpers::SDK_TO_SPI_MAPPINGS[self.name] = type
|
7
|
+
end
|
8
|
+
|
9
|
+
def created_at
|
10
|
+
DateTime.parse(@data[:created_at])
|
11
|
+
end
|
12
|
+
|
13
|
+
def updated_at
|
14
|
+
DateTime.parse(@data[:updated_at])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
RESOURCES = %w{
|
20
|
+
entry
|
21
|
+
user
|
22
|
+
web_page
|
23
|
+
}
|
24
|
+
RESOURCES.each do |resource|
|
25
|
+
require "ordino_sdk/resources/#{resource}"
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module OrdinoSDK
|
2
|
+
class Entry < Resource
|
3
|
+
self.path = "/entries"
|
4
|
+
|
5
|
+
def user
|
6
|
+
@user ||= User.find(user_id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def resource
|
10
|
+
@resource ||= sdk_class_for(resource_type).find(resource_id)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class EntryMock < Entry
|
15
|
+
extend Loquor::ResourceMock
|
16
|
+
|
17
|
+
self.attributes = {
|
18
|
+
id: 50,
|
19
|
+
user_id: 30660,
|
20
|
+
resource_type: "WebPage",
|
21
|
+
resource_id: 17,
|
22
|
+
binder_id: 11,
|
23
|
+
order_value: 100
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module OrdinoSDK
|
2
|
+
class WebPage < Resource
|
3
|
+
self.path = "/web_pages"
|
4
|
+
|
5
|
+
def entries
|
6
|
+
Entry.where(resource_type: "WebPage", resource_id: self.id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.reimport_metadata(id)
|
10
|
+
new Loquor.post("#{path}/#{id}/reimport_metadata", {})
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
class WebPageMock < WebPage
|
16
|
+
extend Loquor::ResourceMock
|
17
|
+
|
18
|
+
self.attributes = {
|
19
|
+
id: 1,
|
20
|
+
created_by_id: 1,
|
21
|
+
site_name: 'FooTube',
|
22
|
+
url: 'http://footube.example.com/foo/bar',
|
23
|
+
title: 'Foo Bar Baz',
|
24
|
+
description: 'The Foo Bar Baz mock external resource is a great FooTube video.'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
data/lib/ordino_sdk.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'active_support/all'
|
2
|
+
require 'loquor'
|
3
|
+
|
4
|
+
require 'ordino_sdk/version'
|
5
|
+
require 'ordino_sdk/configuration'
|
6
|
+
require 'ordino_sdk/mocker'
|
7
|
+
|
8
|
+
require 'ordino_sdk/helpers'
|
9
|
+
require 'ordino_sdk/resource'
|
10
|
+
require 'ordino_sdk/email_shortcodes'
|
11
|
+
|
12
|
+
module OrdinoSDK
|
13
|
+
def self.config
|
14
|
+
@config ||= Configuration.new
|
15
|
+
if block_given?
|
16
|
+
yield @config
|
17
|
+
else
|
18
|
+
@config
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.mock!
|
23
|
+
OrdinoSDK::Mocker.mock!
|
24
|
+
end
|
25
|
+
end
|
data/ordino_sdk.gemspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ordino_sdk/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ordino_sdk"
|
8
|
+
spec.version = OrdinoSDK::VERSION
|
9
|
+
spec.authors = ["Jeremy Walker"]
|
10
|
+
spec.email = ["jez.walker@gmail.com"]
|
11
|
+
spec.description = "Ordino's SDK"
|
12
|
+
spec.summary = "The SDK for Ordino"
|
13
|
+
spec.homepage = "http://github.com/meducation/ordino_sdk"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "activesupport", '>= 3.2.15'
|
22
|
+
spec.add_dependency "loquor", '~> 1.2'
|
23
|
+
spec.add_dependency "filum", '~> 2.0'
|
24
|
+
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
26
|
+
spec.add_development_dependency "rake"
|
27
|
+
spec.add_development_dependency "minitest", '~> 5.0.8'
|
28
|
+
spec.add_development_dependency "mocha"
|
29
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
module OrdinoSDK
|
4
|
+
class ConfigurationTest < Minitest::Test
|
5
|
+
|
6
|
+
def setup
|
7
|
+
super
|
8
|
+
OrdinoSDK.instance_variable_set("@config", nil)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_obtaining_singletion
|
12
|
+
refute OrdinoSDK.config.nil?
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_block_syntax
|
16
|
+
test_key = "foobar-123-access"
|
17
|
+
OrdinoSDK.config do |config|
|
18
|
+
config.access_id = test_key
|
19
|
+
end
|
20
|
+
assert_equal test_key, Loquor.config.access_id
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_endpoint_is_set_correctly
|
24
|
+
Configuration.new
|
25
|
+
assert_equal "http://localhost:3000/spi", Loquor.config.endpoint
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_retry_404s_is_set_correctly
|
29
|
+
Configuration.new
|
30
|
+
assert_equal false, Loquor.config.retry_404s
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_access_id_proxies_to_loquor
|
34
|
+
access_id = "test-access-id"
|
35
|
+
OrdinoSDK.config.access_id = access_id
|
36
|
+
assert_equal access_id, Loquor.config.access_id
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_secret_key_proxies_to_loquor
|
40
|
+
key = "test-secret-key"
|
41
|
+
OrdinoSDK.config.secret_key = key
|
42
|
+
assert_equal key, Loquor.config.secret_key
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_cache_proxies_to_loquor
|
46
|
+
cache = mock()
|
47
|
+
OrdinoSDK.config.cache = cache
|
48
|
+
assert_equal cache, Loquor.config.cache
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/test/mocker_test.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
module OrdinoSDK
|
4
|
+
class MockerTest < Minitest::Test
|
5
|
+
|
6
|
+
def test_mock_switches_classes
|
7
|
+
OrdinoSDK.mock!
|
8
|
+
assert OrdinoSDK.const_defined?(:UserOriginal)
|
9
|
+
assert OrdinoSDK.const_defined?(:User)
|
10
|
+
refute OrdinoSDK.const_defined?(:UserMock)
|
11
|
+
ensure
|
12
|
+
OrdinoSDK::Mocker.unmock!
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_mock_substitutes_in_mock_classes
|
16
|
+
OrdinoSDK.mock!
|
17
|
+
|
18
|
+
id = 1
|
19
|
+
Loquor::HttpAction::Get.expects(:get).never
|
20
|
+
assert id, User.find('id').id
|
21
|
+
ensure
|
22
|
+
OrdinoSDK::Mocker.unmock!
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_mock_sample_returns_media_file_with_attributes
|
26
|
+
OrdinoSDK.mock!
|
27
|
+
|
28
|
+
user = User.sample
|
29
|
+
assert_equal user.email, "jez.walker@gmail.com"
|
30
|
+
assert_equal user.name, "Jeremy Walker"
|
31
|
+
ensure
|
32
|
+
OrdinoSDK::Mocker.unmock!
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
module OrdinoSDK
|
3
|
+
class ResourceTest < Minitest::Test
|
4
|
+
def self.test_resource(klass, url)
|
5
|
+
define_method :klass do klass end
|
6
|
+
define_method :url do url end
|
7
|
+
|
8
|
+
class_eval do
|
9
|
+
def test_path
|
10
|
+
assert_equal url, klass.path
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_generates_find_url
|
14
|
+
id = 7
|
15
|
+
Loquor::HttpAction::Get.expects(:get).with("#{url}/#{id}", anything())
|
16
|
+
klass.find(id)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
define_method 'test_helpers_included' do
|
21
|
+
assert Resource.new({}).respond_to?(:sdk_class_for)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_created_at_is_a_datetime
|
25
|
+
resource = Resource.new(created_at: '2014-02-23T23:34:49Z')
|
26
|
+
assert resource.created_at.is_a?(DateTime)
|
27
|
+
assert_equal DateTime.new(2014, 2, 23, 23, 34, 49), resource.created_at
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../resource_test'
|
3
|
+
|
4
|
+
module OrdinoSDK
|
5
|
+
class EntryTest < ResourceTest
|
6
|
+
test_resource(Entry, '/entries')
|
7
|
+
|
8
|
+
def test_user_calls_sdk
|
9
|
+
entry = Entry.new(user_id: 2)
|
10
|
+
OrdinoSDK::User.expects(:find).with(2)
|
11
|
+
entry.user
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_resource_calls_sdk
|
15
|
+
entry = Entry.new(resource_id: 2, resource_type: "WebPage")
|
16
|
+
OrdinoSDK::WebPage.expects(:find).with(2)
|
17
|
+
entry.resource
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../resource_test'
|
3
|
+
|
4
|
+
module OrdinoSDK
|
5
|
+
class WebPageTest < ResourceTest
|
6
|
+
test_resource(WebPage, '/web_pages')
|
7
|
+
|
8
|
+
def test_can_retrigger_metadata_load
|
9
|
+
Loquor.expects(:post).with('/web_pages/12/reimport_metadata', {})
|
10
|
+
WebPage.reimport_metadata(12)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
gem 'minitest'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'minitest/pride'
|
4
|
+
require 'minitest/mock'
|
5
|
+
require 'mocha/setup'
|
6
|
+
|
7
|
+
lib = File.expand_path('../../lib', __FILE__)
|
8
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
9
|
+
|
10
|
+
require 'ordino_sdk'
|
11
|
+
require_relative 'resources/user_test.rb'
|
12
|
+
|
13
|
+
class Minitest::Test
|
14
|
+
def setup
|
15
|
+
Filum.setup("./log/test.log")
|
16
|
+
OrdinoSDK.config do |config|
|
17
|
+
config.logger = mock()
|
18
|
+
config.logger.stubs(:debug)
|
19
|
+
config.logger.stubs(:info)
|
20
|
+
config.logger.stubs(:error)
|
21
|
+
end
|
22
|
+
Loquor.config do |config|
|
23
|
+
config.logger = OrdinoSDK.config.logger
|
24
|
+
config.access_id = "Sermo"
|
25
|
+
config.secret_key = "foobar"
|
26
|
+
config.endpoint = "http://localhost:3000/spi"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|