mirror of
https://github.com/cmur2/dyndnsd.git
synced 2025-06-26 12:30:18 +02:00
Fiat lux
This commit is contained in:
29
spec/support/dummy_database.rb
Normal file
29
spec/support/dummy_database.rb
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
require 'forwardable'
|
||||
|
||||
module Dyndnsd
|
||||
class DummyDatabase
|
||||
extend Forwardable
|
||||
|
||||
def_delegators :@db, :[], :[]=, :each, :has_key?
|
||||
|
||||
def initialize(db_init)
|
||||
@db_init = db_init
|
||||
end
|
||||
|
||||
def load
|
||||
@db = @db_init
|
||||
@db_hash = @db.hash
|
||||
end
|
||||
|
||||
def save
|
||||
@db_hash = @db.hash
|
||||
end
|
||||
|
||||
def changed?
|
||||
@db_hash != @db.hash
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
10
spec/support/dummy_updater.rb
Normal file
10
spec/support/dummy_updater.rb
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
module Dyndnsd
|
||||
module Updater
|
||||
class Dummy
|
||||
def update(zone)
|
||||
# nothing
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user