public
Description: Blanket is a flexible backup framework designed to get the drudgery out of the way and to make automated backups easy.
Homepage: http://jimvanfleet.com/projects/blanket
Clone URL: git://github.com/bigfleet/blanket.git
blanket / spec / reader_spec.rb
100644 70 lines (48 sloc) 1.629 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
require File.dirname(__FILE__) + "/spec_helper.rb"
 
describe "The YAML config file" do
  
  describe "for S3" do
    before do
      file = File.dirname(__FILE__) + "/fixtures/s3-info.yml"
      @reader = Blanket::Reader.new(file)
    end
    
    it "should instantiate a reader from a file" do
      @reader.should_not be_nil
    end
    
    it "should define the sink type as S3" do
      @reader.sink_type.should == "S3"
    end
    
    
    it "should define the access key id" do
      @reader.access_key_id.should == "your-id"
    end
    
    it "should define the secret key id" do
      @reader.secret_access_key.should == "your-secret-key"
    end
    
    it "should report the S3 keys as its own" do
      @reader.keys.should == S3.attribute_symbols
    end
    
    
  end
  
  describe "for Confluence" do
    before do
      file = File.dirname(__FILE__) + "/fixtures/confluence.yml"
      @reader = Blanket::Reader.new(file)
    end
    
    it "should define the blanket type as Confluence" do
      @reader.source_type.should == "Confluence"
    end
    
    it "should define the host" do
      @reader.host.should == "yourhost.com"
    end
    
    it "should define the user" do
      @reader.user.should == "username"
    end
    
    it "should define the password" do
      @reader.password.should == "password"
    end
    
    it "should define the backup directory" do
      @reader.remote_directory.should == "/path/to/remote/confluence/backups"
    end
 
    it "should report the Confluence keys as its own" do
      @reader.keys.should == Confluence.attribute_symbols
    end
    
  end
  
end