examples/unit/config_example.rb in astrails-safe-0.1.6 vs examples/unit/config_example.rb in astrails-safe-0.1.7
- old
+ new
@@ -1,9 +1,9 @@
require File.expand_path(File.dirname(__FILE__) + '/../example_helper')
describe Astrails::Safe::Config do
- it "foo" do
+ it "should parse example config" do
config = Astrails::Safe::Config::Node.new do
local do
path "path"
end
@@ -45,11 +45,34 @@
skip_tables [:logger_exceptions, :request_logs]
end
end
+ pgdump do
+ options "-i -x -O"
+ user "astrails"
+ password ""
+ host "localhost"
+ port 5432
+
+ database :blog
+
+ database :production do
+ keep :local => 3
+
+ skip_tables [:logger_exceptions, :request_logs]
+ end
+
+ end
+
+ svndump do
+ repo :my_repo do
+ repo_path "/home/svn/my_repo"
+ end
+ end
+
tar do
archive "git-repositories" do
files "/home/git/repositories"
end
@@ -103,10 +126,35 @@
"gpg" => {"password" => "custom-production-pass"},
"skip_tables" => ["logger_exceptions", "request_logs"],
},
},
},
+
+ "pgdump" => {
+ "options" => "-i -x -O",
+ "user" => "astrails",
+ "password" => "",
+ "host" => "localhost",
+ "port" => 5432,
+
+ "databases" => {
+ "blog" => {},
+ "production" => {
+ "keep" => {"local" => 3},
+ "skip_tables" => ["logger_exceptions", "request_logs"],
+ },
+ },
+ },
+
+ "svndump" => {
+ "repos" => {
+ "my_repo"=> {
+ "repo_path" => "/home/svn/my_repo"
+ }
+ }
+ },
+
"tar" => {
"archives" => {
"git-repositories" => {"files" => "/home/git/repositories"},
"etc-files" => {"files" => "/etc", "exclude" => "/etc/puppet/other"},
"dot-configs" => {"files" => "/home/*/.[^.]*"},
@@ -118,9 +166,7 @@
},
},
}
config.to_hash.should == expected
-
end
end
-