fauna 1.3.2 → 1.3.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.
@@ -1,7 +1,6 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
 
3
3
  class DatabaseTest < MiniTest::Unit::TestCase
4
-
5
4
  def setup
6
5
  super
7
6
  @model = Fauna::Resource.new 'databases', :name => 'fauna-ruby-test2'
@@ -12,19 +11,19 @@ class DatabaseTest < MiniTest::Unit::TestCase
12
11
 
13
12
  def test_get
14
13
  assert_raises(Fauna::Connection::PermissionDenied) do
15
- Fauna::Resource.find("databases/fauna-ruby-test")
14
+ Fauna::Resource.find('databases/fauna-ruby-test')
16
15
  end
17
16
 
18
17
  assert_raises(Fauna::Connection::PermissionDenied) do
19
- Fauna::Resource.find("databases/nonexistent")
18
+ Fauna::Resource.find('databases/nonexistent')
20
19
  end
21
20
 
22
21
  Fauna::Client.context(@root_connection) do
23
- Fauna::Resource.find("databases/fauna-ruby-test")
24
- Fauna::Resource.find("databases/fauna-ruby-test2")
22
+ Fauna::Resource.find('databases/fauna-ruby-test')
23
+ Fauna::Resource.find('databases/fauna-ruby-test2')
25
24
 
26
25
  assert_raises(Fauna::Connection::NotFound) do
27
- Fauna::Resource.find("databases/nonexistent")
26
+ Fauna::Resource.find('databases/nonexistent')
28
27
  end
29
28
  end
30
29
  end
data/test/query_test.rb CHANGED
@@ -1,28 +1,32 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
 
3
- # TODO use association_test classes
3
+ # TODO: use association_test classes
4
4
 
5
5
  class QueryTest < MiniTest::Unit::TestCase
6
-
7
- def setup
6
+ def setup # rubocop:disable Metrics/MethodLength
8
7
  super
9
8
  @model = Fauna::Resource.create 'classes/message_boards'
10
9
  @posts_set = @model.set 'posts'
11
10
  @posts = []
12
11
  @comments = []
13
12
 
14
- 3.times do |i|
13
+ 3.times do
15
14
  post = Fauna::Resource.create(
16
15
  'classes/posts',
17
- { :data =>
18
- { :topic => "The Horned King" } })
16
+ :data =>
17
+ { :topic => 'The Horned King' },
18
+ )
19
+
19
20
  @posts << post
20
21
  @posts_set.add(post)
21
- 3.times do |j|
22
+
23
+ 3.times do
22
24
  comment = Fauna::Resource.create(
23
25
  'classes/comments',
24
- { :data =>
25
- { :text => "Do not show the Horned King the whereabouts of the Black Cauldron!" } })
26
+ :data =>
27
+ { :text => 'Do not show the Horned King the whereabouts of the Black Cauldron!' },
28
+ )
29
+
26
30
  @comments << comment
27
31
  Fauna::CustomSet.new("#{post.ref}/sets/comments").add(comment)
28
32
  end
data/test/readme_test.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
 
3
3
  class ReadmeTest < MiniTest::Unit::TestCase
4
- def test_readme
5
- code = ""
4
+ def test_readme # rubocop:disable Metrics/MethodLength
5
+ code = ''
6
6
 
7
- sections = File.read(File.expand_path("../../README.md", __FILE__)).split("```")
8
- sections.select do |text|
7
+ sections = File.read(File.expand_path('../../README.md', __FILE__)).split('```')
8
+ sections.select do |text| # rubocop:disable Style/Next
9
9
  if text =~ /^ruby/
10
10
  next if text =~ /ActionController|logger/
11
11
  text.gsub!('$fauna = Fauna::Connection.new(secret: server_key)', '$fauna = SERVER_CONNECTION')
@@ -13,7 +13,7 @@ class ReadmeTest < MiniTest::Unit::TestCase
13
13
  end
14
14
  end
15
15
 
16
- tmp = File.open("/tmp/fauna-ruby-readme-eval.rb", "w")
16
+ tmp = File.open('/tmp/fauna-ruby-readme-eval.rb', 'w')
17
17
  tmp.write(code)
18
18
  tmp.close
19
19
 
data/test/set_test.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
 
3
- # TODO use association_test classes
3
+ # TODO: use association_test classes
4
4
 
5
5
  class SetTest < MiniTest::Unit::TestCase
6
-
7
6
  def setup
8
7
  super
9
8
  @model = Fauna::Resource.create 'classes/message_boards'
@@ -17,7 +16,7 @@ class SetTest < MiniTest::Unit::TestCase
17
16
  assert_equal 0, page.fauna_count
18
17
  end
19
18
 
20
- def test_pagination
19
+ def test_pagination # rubocop:disable Metrics/MethodLength
21
20
  @posts.add(Fauna::Resource.create 'classes/posts')
22
21
  @posts.add(Fauna::Resource.create 'classes/posts')
23
22
  @posts.add(Fauna::Resource.create 'classes/posts')
data/test/test_helper.rb CHANGED
@@ -1,29 +1,29 @@
1
1
  libdir = File.dirname(File.dirname(__FILE__)) + '/lib'
2
2
  $LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)
3
3
 
4
- require "rubygems"
5
- require "test/unit"
6
- require "fauna"
7
- require "securerandom"
8
- require "mocha/setup"
9
-
10
- FAUNA_ROOT_KEY = ENV["FAUNA_ROOT_KEY"]
11
- FAUNA_DOMAIN = ENV["FAUNA_DOMAIN"]
12
- FAUNA_SCHEME = ENV["FAUNA_SCHEME"]
13
- FAUNA_PORT = ENV["FAUNA_PORT"]
14
-
15
- if !FAUNA_ROOT_KEY
16
- raise "FAUNA_ROOT_KEY must be defined in your environment to run tests."
4
+ require 'rubygems'
5
+ require 'test/unit'
6
+ require 'fauna'
7
+ require 'securerandom'
8
+ require 'mocha/setup'
9
+
10
+ FAUNA_ROOT_KEY = ENV['FAUNA_ROOT_KEY']
11
+ FAUNA_DOMAIN = ENV['FAUNA_DOMAIN']
12
+ FAUNA_SCHEME = ENV['FAUNA_SCHEME']
13
+ FAUNA_PORT = ENV['FAUNA_PORT']
14
+
15
+ unless FAUNA_ROOT_KEY
16
+ fail 'FAUNA_ROOT_KEY must be defined in your environment to run tests.'
17
17
  end
18
18
 
19
19
  ROOT_CONNECTION = Fauna::Connection.new(:secret => FAUNA_ROOT_KEY, :domain => FAUNA_DOMAIN, :scheme => FAUNA_SCHEME, :port => FAUNA_PORT)
20
20
 
21
21
  Fauna::Client.context(ROOT_CONNECTION) do
22
- Fauna::Resource.new('databases', :name => "fauna-ruby-test").delete rescue nil
23
- Fauna::Resource.create 'databases', :name => "fauna-ruby-test"
22
+ Fauna::Resource.new('databases', :name => 'fauna-ruby-test').delete rescue nil # rubocop:disable Style/RescueModifier
23
+ Fauna::Resource.create 'databases', :name => 'fauna-ruby-test'
24
24
 
25
- server_key = Fauna::Resource.create 'keys', :database => "databases/fauna-ruby-test", :role => "server"
26
- client_key = Fauna::Resource.create 'keys', :database => "databases/fauna-ruby-test", :role => "client"
25
+ server_key = Fauna::Resource.create 'keys', :database => 'databases/fauna-ruby-test', :role => 'server'
26
+ client_key = Fauna::Resource.create 'keys', :database => 'databases/fauna-ruby-test', :role => 'client'
27
27
 
28
28
  SERVER_CONNECTION = Fauna::Connection.new(:secret => server_key.secret, :domain => FAUNA_DOMAIN, :scheme => FAUNA_SCHEME, :port => FAUNA_PORT)
29
29
  CLIENT_CONNECTION = Fauna::Connection.new(:secret => client_key.secret, :domain => FAUNA_DOMAIN, :scheme => FAUNA_SCHEME, :port => FAUNA_PORT)
@@ -52,32 +52,35 @@ Fauna::Client.context(SERVER_CONNECTION) do
52
52
  end
53
53
 
54
54
  # test harness
55
-
56
- class MiniTest::Unit::TestCase
57
- def setup
58
- @root_connection = ROOT_CONNECTION
59
- @server_connection = SERVER_CONNECTION
60
- @client_connection = CLIENT_CONNECTION
61
- Fauna::Client.push_context(@server_connection)
62
- end
63
-
64
- def teardown
65
- Fauna::Client.pop_context
66
- end
67
-
68
- def email
69
- "#{SecureRandom.random_number}@example.com"
70
- end
71
-
72
- def fail
73
- assert false, "Not implemented"
74
- end
75
-
76
- def pass
77
- assert true
78
- end
79
-
80
- def password
81
- SecureRandom.random_number.to_s
55
+ module MiniTest
56
+ class Unit
57
+ class TestCase
58
+ def setup
59
+ @root_connection = ROOT_CONNECTION
60
+ @server_connection = SERVER_CONNECTION
61
+ @client_connection = CLIENT_CONNECTION
62
+ Fauna::Client.push_context(@server_connection)
63
+ end
64
+
65
+ def teardown
66
+ Fauna::Client.pop_context
67
+ end
68
+
69
+ def email
70
+ "#{SecureRandom.random_number}@example.com"
71
+ end
72
+
73
+ def fail
74
+ assert false, 'Not implemented'
75
+ end
76
+
77
+ def pass
78
+ assert true
79
+ end
80
+
81
+ def password
82
+ SecureRandom.random_number.to_s
83
+ end
84
+ end
82
85
  end
83
86
  end
metadata CHANGED
@@ -1,43 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fauna
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fauna, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - !binary |-
12
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURhRENDQWxDZ0F3SUJB
13
- Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREE5TVEwd0N3WURWUVFEREFSbGRt
14
- RnUKTVJnd0ZnWUtDWkltaVpQeUxHUUJHUllJWTJ4dmRXUmlkWEl4RWpBUUJn
15
- b0praWFKay9Jc1pBRVpGZ0p6ZERBZQpGdzB4TXpFeE1EUXlNREkxTURWYUZ3
16
- MHhOREV4TURReU1ESTFNRFZhTUQweERUQUxCZ05WQkFNTUJHVjJZVzR4CkdE
17
- QVdCZ29Ka2lhSmsvSXNaQUVaRmdoamJHOTFaR0oxY2pFU01CQUdDZ21TSm9t
18
- VDhpeGtBUmtXQW5OME1JSUIKSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4
19
- QU1JSUJDZ0tDQVFFQXVHNHEySWRUdGxjNy9JSmtXUG5iT0FGdAp5c0tjM1ht
20
- TEhzamVTWFhTUGRRMW1iMmNEWHZ5RFM4VGt6anJnRG9KOTZSUjJ4cmg3YmZr
21
- SEFNSmhTVk1oc1BNCnJuWVM3ZkRzLy9YMWg2ZlJZQmpqaHFHZVFoQ0wxeHJT
22
- NS9JNHZLYjdBamdGbnVVYk1aL0gwK2ljMkljMnpUbloKanR0U1FaL1FPbFl5
23
- Y3RyWW9UekFGZFB3TCtkT3hza095QW1BYn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 cert_chain: []
11
+ date: 2014-11-18 00:00:00.000000000 Z
41
12
  dependencies:
42
13
  - !ruby/object:Gem::Dependency
43
14
  name: faraday
@@ -109,6 +80,20 @@ dependencies:
109
80
  - - ~>
110
81
  - !ruby/object:Gem::Version
111
82
  version: '4.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
112
97
  description: Ruby client for the Fauna distributed database.
113
98
  email: ''
114
99
  executables: []
@@ -134,7 +119,6 @@ files:
134
119
  - Manifest
135
120
  - README.md
136
121
  - Rakefile
137
- - fauna-ruby.pem
138
122
  - fauna.gemspec
139
123
  - lib/fauna.rb
140
124
  - lib/fauna/cache.rb
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- H�j>ת��_�8��X�J/Ȏ^Y��ϵ�B��x�k-2*�Owr�a�2Ru߮�^���
2
- �P��I~�$�����8�/����
data/fauna-ruby.pem DELETED
@@ -1,21 +0,0 @@
1
- -----BEGIN CERTIFICATE-----
2
- MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA9MQ0wCwYDVQQDDARldmFu
3
- MRgwFgYKCZImiZPyLGQBGRYIY2xvdWRidXIxEjAQBgoJkiaJk/IsZAEZFgJzdDAe
4
- Fw0xMzExMDQyMDI1MDVaFw0xNDExMDQyMDI1MDVaMD0xDTALBgNVBAMMBGV2YW4x
5
- GDAWBgoJkiaJk/IsZAEZFghjbG91ZGJ1cjESMBAGCgmSJomT8ixkARkWAnN0MIIB
6
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuG4q2IdTtlc7/IJkWPnbOAFt
7
- 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