mordor-auditing 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mordor-auditing (0.0.9)
5
- mordor (= 0.2.5)
4
+ mordor-auditing (0.0.10)
5
+ mordor (= 0.2.8)
6
6
 
7
7
  GEM
8
8
  specs:
@@ -13,7 +13,7 @@ GEM
13
13
  json (1.6.1)
14
14
  mongo (1.4.0)
15
15
  bson (= 1.4.0)
16
- mordor (0.2.5)
16
+ mordor (0.2.8)
17
17
  bson_ext
18
18
  extlib
19
19
  json
@@ -32,7 +32,7 @@ PLATFORMS
32
32
  ruby
33
33
 
34
34
  DEPENDENCIES
35
- mordor (= 0.2.5)
35
+ mordor (= 0.2.8)
36
36
  mordor-auditing!
37
37
  rake
38
38
  rspec (~> 2.0)
data/auditing.gemspec CHANGED
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
2
2
  s.name = "mordor-auditing"
3
3
 
4
4
  # Do not set the version and date field manually, this is done by the release script
5
- s.version = "0.0.10"
6
- s.date = "2012-01-03"
5
+ s.version = "0.0.11"
6
+ s.date = "2012-01-04"
7
7
 
8
8
  s.summary = "mordor-auditing"
9
9
  s.description = <<-eos
@@ -13,9 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.add_development_dependency('rake')
14
14
  s.add_development_dependency('rspec', '~> 2.0')
15
15
 
16
- s.add_development_dependency('mordor', '0.2.5')
16
+ s.add_development_dependency('mordor', '0.2.8')
17
17
 
18
- s.add_runtime_dependency('mordor', '0.2.5')
18
+ s.add_runtime_dependency('mordor', '0.2.8')
19
19
 
20
20
  s.authors = ['Jan-Willem Koelewijn', 'Dirkjan Bussink']
21
21
  s.email = ['janwillem.koelewijn@nedap.com', 'dirkjan.bussink@nedap.com']
data/lib/auditing.rb CHANGED
@@ -6,6 +6,10 @@ require 'auditing/version'
6
6
  require 'auditing/request'
7
7
  require 'auditing/modification'
8
8
 
9
+ Mordor::Config.use do |config|
10
+ config[:database] = 'development89'
11
+ end
12
+
9
13
  unless Object.const_defined?('BigDecimal')
10
14
  BigDecimal = Float
11
15
  end
@@ -80,19 +84,3 @@ class Time
80
84
  end
81
85
  end
82
86
  end
83
-
84
- module Mordor
85
- CONFIG = {
86
- :hostname => 'localhost',
87
- :port => 27017,
88
- :database => 'development'
89
- }
90
-
91
- def connection
92
- @connection ||= Mongo::Connection.new(CONFIG[:hostname], CONFIG[:port])
93
- @connection.autenticate(CONFIG[:username], CONFIG[:password]) if CONFIG[:username]
94
- @connection.db(CONFIG[:database])
95
- end
96
- module_function :connection
97
-
98
- end
@@ -30,10 +30,6 @@ end
30
30
  describe "with respect to modifications" do
31
31
  include AuditingModificationSpecHelper
32
32
 
33
- before :each do
34
- clean_sheet
35
- end
36
-
37
33
  it "should correctly initialize" do
38
34
  options = {
39
35
  :object_type => 'String',
@@ -75,6 +71,10 @@ describe "with respect to modifications" do
75
71
  end
76
72
 
77
73
  context "with respect to saving and retrieving" do
74
+ before :each do
75
+ clean_sheet
76
+ end
77
+
78
78
  it "should correctly save the modification" do
79
79
  options = {
80
80
  :object_type => 'String',
@@ -98,6 +98,8 @@ describe "with respect to modifications" do
98
98
 
99
99
  describe "with respect to retrieval" do
100
100
  before :each do
101
+ clean_sheet
102
+
101
103
  options = {
102
104
  :object_type => 'String',
103
105
  :object_id => 2,
@@ -118,6 +120,7 @@ describe "with respect to modifications" do
118
120
 
119
121
  it "should correctly retrieve requests on a certain day" do
120
122
  mods = Auditing::Modification.find_by_day(Date.today)
123
+
121
124
  mods.size.should == 1
122
125
  compare_modifications(@modification, mods.first)
123
126
 
data/spec/spec_helper.rb CHANGED
@@ -5,19 +5,14 @@ require 'mordor'
5
5
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
6
6
  require 'auditing'
7
7
 
8
- module Mordor
9
- CONFIG = {
10
- :hostname => 'localhost',
11
- :port => 27017,
12
- :database => 'test'
13
- }
8
+ Mordor::Config.use do |config|
9
+ config[:database] = 'test'
14
10
  end
15
11
 
16
12
  def clean_sheet
17
- @connection ||= Mongo::Connection.new(Mordor::CONFIG[:hostname], Mordor::CONFIG[:port])
18
- @db ||= @connection[Mordor::CONFIG[:database]]
13
+ @connection = Mongo::Connection.new(Mordor::Config[:hostname], Mordor::Config[:port])
14
+ @db = @connection[Mordor::Config[:database]]
19
15
  [Auditing::Request, Auditing::Modification].each do |klass|
20
16
  @db[klass.collection_name].drop
21
17
  end
22
18
  end
23
-
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mordor-auditing
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jan-Willem Koelewijn
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-01-03 00:00:00 +01:00
19
+ date: 2012-01-04 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -56,12 +56,12 @@ dependencies:
56
56
  requirements:
57
57
  - - "="
58
58
  - !ruby/object:Gem::Version
59
- hash: 29
59
+ hash: 7
60
60
  segments:
61
61
  - 0
62
62
  - 2
63
- - 5
64
- version: 0.2.5
63
+ - 8
64
+ version: 0.2.8
65
65
  type: :development
66
66
  version_requirements: *id003
67
67
  - !ruby/object:Gem::Dependency
@@ -72,12 +72,12 @@ dependencies:
72
72
  requirements:
73
73
  - - "="
74
74
  - !ruby/object:Gem::Version
75
- hash: 29
75
+ hash: 7
76
76
  segments:
77
77
  - 0
78
78
  - 2
79
- - 5
80
- version: 0.2.5
79
+ - 8
80
+ version: 0.2.8
81
81
  type: :runtime
82
82
  version_requirements: *id004
83
83
  description: " Auditing classes based on the Mordor gem, used to audit requests and modifications on objects\n"