lmdb 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/lmdb_spec.rb ADDED
@@ -0,0 +1,41 @@
1
+ require 'spec_helper'
2
+
3
+ describe LMDB do
4
+
5
+ describe "constants" do
6
+ it 'has version constants' do
7
+ LMDB::VERSION_MAJOR.should be_instance_of(Fixnum)
8
+ LMDB::VERSION_MINOR.should be_instance_of(Fixnum)
9
+ LMDB::VERSION_PATCH.should be_instance_of(Fixnum)
10
+ LMDB::VERSION.should be_instance_of(String)
11
+ end
12
+
13
+ it 'has environment flags' do
14
+ LMDB::FIXEDMAP.should be_instance_of(Fixnum)
15
+ LMDB::NOSUBDIR.should be_instance_of(Fixnum)
16
+ LMDB::NOSYNC.should be_instance_of(Fixnum)
17
+ LMDB::RDONLY.should be_instance_of(Fixnum)
18
+ LMDB::NOMETASYNC.should be_instance_of(Fixnum)
19
+ LMDB::WRITEMAP.should be_instance_of(Fixnum)
20
+ LMDB::MAPASYNC.should be_instance_of(Fixnum)
21
+ end
22
+
23
+ it 'has database flags' do
24
+ LMDB::REVERSEKEY.should be_instance_of(Fixnum)
25
+ LMDB::DUPSORT.should be_instance_of(Fixnum)
26
+ LMDB::INTEGERKEY.should be_instance_of(Fixnum)
27
+ LMDB::DUPFIXED.should be_instance_of(Fixnum)
28
+ LMDB::INTEGERDUP.should be_instance_of(Fixnum)
29
+ LMDB::REVERSEDUP.should be_instance_of(Fixnum)
30
+ LMDB::CREATE.should be_instance_of(Fixnum)
31
+ LMDB::NOOVERWRITE.should be_instance_of(Fixnum)
32
+ LMDB::NODUPDATA.should be_instance_of(Fixnum)
33
+ LMDB::CURRENT.should be_instance_of(Fixnum)
34
+ LMDB::RESERVE.should be_instance_of(Fixnum)
35
+ LMDB::APPEND.should be_instance_of(Fixnum)
36
+ LMDB::APPENDDUP.should be_instance_of(Fixnum)
37
+ LMDB::MULTIPLE.should be_instance_of(Fixnum)
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,33 @@
1
+ require 'bundler/setup'
2
+ require 'lmdb'
3
+ require 'rspec'
4
+ require 'fileutils'
5
+ require 'pathname'
6
+
7
+ SPEC_ROOT = Pathname.new File.expand_path('..', __FILE__)
8
+ TEMP_ROOT = SPEC_ROOT.join("tmp")
9
+
10
+ module LMDB::SpecHelper
11
+
12
+ def mkpath(name = 'env')
13
+ TEMP_ROOT.join(name).to_s.tap do |path|
14
+ FileUtils.mkpath(path)
15
+ end
16
+ end
17
+
18
+ def path
19
+ @path ||= mkpath
20
+ end
21
+
22
+ def env
23
+ @env ||= LMDB::Environment.new path: path
24
+ end
25
+
26
+ end
27
+
28
+ RSpec.configure do |c|
29
+ #c.filter_run_excluding segfault: true
30
+ c.include LMDB::SpecHelper
31
+ c.after { FileUtils.rm_rf TEMP_ROOT.to_s }
32
+ end
33
+
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lmdb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Mendler
8
+ - Black Square Media
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-09-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rake
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake-compiler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ description: imdb is a Ruby binding to OpenLDAP Lightning MDB.
57
+ email: mail@daniel-mendler.de
58
+ executables: []
59
+ extensions:
60
+ - ext/lmdb_ext/extconf.rb
61
+ extra_rdoc_files: []
62
+ files:
63
+ - .gitignore
64
+ - CHANGES
65
+ - CONTRIBUTORS
66
+ - Gemfile
67
+ - README.md
68
+ - Rakefile
69
+ - ext/lmdb_ext/errors.h
70
+ - ext/lmdb_ext/extconf.rb
71
+ - ext/lmdb_ext/liblmdb/.gitignore
72
+ - ext/lmdb_ext/liblmdb/CHANGES
73
+ - ext/lmdb_ext/liblmdb/COPYRIGHT
74
+ - ext/lmdb_ext/liblmdb/LICENSE
75
+ - ext/lmdb_ext/liblmdb/lmdb.h
76
+ - ext/lmdb_ext/liblmdb/mdb.c
77
+ - ext/lmdb_ext/liblmdb/midl.c
78
+ - ext/lmdb_ext/liblmdb/midl.h
79
+ - ext/lmdb_ext/lmdb_ext.c
80
+ - lib/lmdb.rb
81
+ - lib/lmdb/database.rb
82
+ - lib/lmdb/environment.rb
83
+ - lmdb.gemspec
84
+ - spec/lmdb/database_spec.rb
85
+ - spec/lmdb/environment_spec.rb
86
+ - spec/lmdb/lmdb_ext_spec.rb
87
+ - spec/lmdb_spec.rb
88
+ - spec/spec_helper.rb
89
+ homepage: https://github.com/minad/mdb
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.0.0
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: Ruby bindings to Lightning MDB
113
+ test_files:
114
+ - spec/lmdb/database_spec.rb
115
+ - spec/lmdb/environment_spec.rb
116
+ - spec/lmdb/lmdb_ext_spec.rb
117
+ - spec/lmdb_spec.rb
118
+ - spec/spec_helper.rb