BuildMaster 1.0.9 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/buildmaster/algorithms.rb +3 -0
- data/lib/buildmaster/algorithms/opn_compare.rb +108 -0
- data/lib/buildmaster/cotta/cotta_dir.rb +7 -4
- data/lib/buildmaster/cotta/cotta_file.rb +5 -2
- data/lib/buildmaster/cotta/in_memory_system.rb +28 -4
- data/lib/buildmaster/project/java.rb +4 -0
- data/lib/buildmaster/project/java/class_path.rb +0 -0
- data/lib/buildmaster/project/java/javac.rb +9 -0
- data/lib/buildmaster/project/mysql_served_driver.rb +15 -0
- data/lib/buildmaster/project/pscp_driver.rb +0 -1
- data/lib/buildmaster/project/svn_driver.rb +4 -4
- data/lib/buildmaster/project/svn_server_driver.rb +18 -0
- data/lib/buildmaster/project/svn_status_info.rb +45 -42
- data/lib/buildmaster/site/content_engine_repository.rb +9 -0
- data/lib/buildmaster/site/file_processor.rb +5 -1
- data/lib/buildmaster/site/site.rb +11 -4
- data/lib/buildmaster/site/site_server.rb +1 -1
- data/lib/buildmaster/site/templatelets/href.rb +1 -1
- data/lib/buildmaster/version +1 -1
- data/test/buildmaster/algorithms/tc_opn_compare.rb +44 -0
- data/test/buildmaster/common/tc_properties.rb +8 -8
- data/test/buildmaster/common/tc_tree_to_object.rb +8 -8
- data/test/buildmaster/cotta/cotta_dir_behaviors.rb +167 -0
- data/test/buildmaster/cotta/cotta_file_behaviors.rb +127 -0
- data/test/buildmaster/cotta/cotta_specifications.rb +20 -0
- data/test/buildmaster/cotta/file_system_behaviors.rb +167 -0
- data/test/buildmaster/cotta/tc_command_interface.rb +6 -6
- data/test/buildmaster/cotta/tc_command_runner.rb +5 -5
- data/test/buildmaster/cotta/tc_cotta.rb +12 -12
- data/test/buildmaster/cotta/tc_cotta_dir_in_memory.rb +17 -17
- data/test/buildmaster/cotta/tc_cotta_dir_physical.rb +5 -5
- data/test/buildmaster/cotta/tc_cotta_file_in_memory.rb +8 -9
- data/test/buildmaster/cotta/tc_cotta_file_physical.rb +11 -8
- data/test/buildmaster/cotta/tc_cotta_zip_support.rb +9 -9
- data/test/buildmaster/cotta/tc_in_memory_system.rb +7 -7
- data/test/buildmaster/cotta/tc_io_chain.rb +3 -3
- data/test/buildmaster/cotta/tc_pathname.rb +6 -6
- data/test/buildmaster/cotta/tc_physical_system.rb +7 -8
- data/test/buildmaster/project/tc_ant_driver.rb +8 -8
- data/test/buildmaster/project/tc_build_number_file.rb +5 -5
- data/test/buildmaster/project/tc_cvs_driver.rb +9 -9
- data/test/buildmaster/project/tc_java_manifest.rb +9 -11
- data/test/buildmaster/project/tc_release.rb +12 -12
- data/test/buildmaster/project/tc_server_manager.rb +8 -8
- data/test/buildmaster/project/tc_svn_driver.rb +18 -13
- data/test/buildmaster/project/tc_svn_status_info.rb +8 -8
- data/test/buildmaster/project/tc_version_number_file.rb +6 -6
- data/test/buildmaster/project/windows/tc_iis_driver.rb +4 -4
- data/test/buildmaster/project/windows/tc_sql_server_driver.rb +2 -2
- data/test/buildmaster/site/content/tc_content_engine_repository.rb +5 -5
- data/test/buildmaster/site/tc_element_processor_by_name.rb +4 -4
- data/test/buildmaster/site/tc_file_processor.rb +8 -9
- data/test/buildmaster/site/tc_site.rb +23 -7
- data/test/buildmaster/site/tc_site_server.rb +2 -2
- data/test/buildmaster/site/tc_site_spec.rb +5 -5
- data/test/buildmaster/site/tc_source_file_handler.rb +2 -2
- data/test/buildmaster/site/tc_template_builder.rb +22 -11
- data/test/buildmaster/site/tc_template_error.rb +2 -2
- data/test/buildmaster/site/tc_template_runner.rb +4 -4
- data/test/buildmaster/site/tc_templatelets.rb +4 -4
- data/test/buildmaster/site/tc_xtemplate.rb +5 -5
- data/test/buildmaster/site/templatelets/tc_attribute.rb +6 -6
- data/test/buildmaster/site/templatelets/tc_code.rb +10 -10
- data/test/buildmaster/site/templatelets/tc_each.rb +3 -3
- data/test/buildmaster/site/templatelets/tc_href.rb +7 -7
- data/test/buildmaster/site/templatelets/tc_include.rb +3 -3
- data/test/buildmaster/site/templatelets/tc_link.rb +6 -6
- data/test/buildmaster/site/templatelets/tc_text.rb +4 -4
- data/test/buildmaster/site/templatelets/tc_when.rb +4 -4
- data/test/tmp/svn_test/repository/db/revprops/0 +1 -1
- data/test/tmp/svn_test/repository/db/revprops/1 +1 -1
- data/test/tmp/svn_test/repository/db/revprops/2 +1 -1
- data/test/tmp/svn_test/repository/db/revprops/3 +1 -1
- data/test/tmp/svn_test/repository/db/revprops/4 +1 -1
- data/test/tmp/svn_test/repository/db/uuid +1 -1
- metadata +60 -46
@@ -37,6 +37,8 @@ def register_cotta_file_specifications
|
|
37
37
|
specify 'file should support stat' do
|
38
38
|
@file.save('test')
|
39
39
|
@file.stat.should_not_be_nil
|
40
|
+
@file.stat.size.should == 4
|
41
|
+
@file.stat.writable?.should == true
|
40
42
|
end
|
41
43
|
|
42
44
|
specify 'should raise error if does not exist' do
|
@@ -108,6 +110,15 @@ def register_cotta_file_specifications
|
|
108
110
|
lambda {@file.delete}.should_raise Errno::ENOENT
|
109
111
|
end
|
110
112
|
|
113
|
+
specify 'should check timestamp to see which one is older' do
|
114
|
+
@file.save
|
115
|
+
file2 = @file.parent.file('another.txt')
|
116
|
+
sleep 1
|
117
|
+
file2.save
|
118
|
+
@file.older_than?(file2).should == true
|
119
|
+
file2.older_than?(@file).should == false
|
120
|
+
end
|
121
|
+
|
111
122
|
end
|
112
123
|
|
113
124
|
def register_cotta_dir_specifications
|
@@ -249,6 +260,15 @@ def register_cotta_dir_specifications
|
|
249
260
|
dir = BuildMaster::CottaDir.new(@system, Pathname.new('no/such/directory'))
|
250
261
|
Proc.new {dir.list}.should_raise Errno::ENOENT
|
251
262
|
end
|
263
|
+
|
264
|
+
specify 'allow filter for archive' do
|
265
|
+
@dir.file('in/in.txt').save('test')
|
266
|
+
@dir.file('out/out.txt').save('test')
|
267
|
+
result = @dir.archive {|entry| entry.name != 'out'}
|
268
|
+
target = result.extract(@dir.dir('extract'))
|
269
|
+
target.dir('out').should_not_be_exist
|
270
|
+
target.dir('in').should_be_exist
|
271
|
+
end
|
252
272
|
|
253
273
|
end
|
254
274
|
|
@@ -0,0 +1,167 @@
|
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'buildmaster')
|
2
|
+
|
3
|
+
require 'cotta'
|
4
|
+
require 'pathname'
|
5
|
+
require 'spec'
|
6
|
+
|
7
|
+
module BuildMaster
|
8
|
+
describe 'FileSystemBehaviors', :shared=>true do
|
9
|
+
before do
|
10
|
+
create_system
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'current directory always exists' do
|
14
|
+
@system.dir_exists?(Pathname.new('.')).should == true
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'mkdir should create directory' do
|
18
|
+
pathname = Pathname.new('/one')
|
19
|
+
@system.dir_exists?(pathname).should == false
|
20
|
+
@system.mkdir(pathname)
|
21
|
+
@system.dir_exists?(pathname).should == true
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'mkdir raise error if dir already exists' do
|
25
|
+
pathname = Pathname.new('/one')
|
26
|
+
@system.mkdir(pathname)
|
27
|
+
lambda {
|
28
|
+
@system.mkdir
|
29
|
+
}.should raise_error(StandardError)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'io returns IO handle' do
|
33
|
+
pathname = Pathname.new('file.txt')
|
34
|
+
@system.file_exists?(pathname).should == false
|
35
|
+
write_io = load_io(pathname, 'w')
|
36
|
+
write_io.puts 'content'
|
37
|
+
write_io.close
|
38
|
+
@system.file_exists?(pathname).should == true
|
39
|
+
read_io = load_io(pathname, 'r')
|
40
|
+
read_io.gets.should == "content\n"
|
41
|
+
read_io.close
|
42
|
+
@system.delete_file(pathname)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'file creation should leave file system consistent' do
|
46
|
+
pathname = Pathname.new('dir/sub/file.txt')
|
47
|
+
@system.mkdir(pathname.parent.parent)
|
48
|
+
@system.mkdir(pathname.parent)
|
49
|
+
@system.file_exists?(pathname).should == false
|
50
|
+
@system.dir_exists?(pathname.parent).should == true
|
51
|
+
load_io(pathname, 'w').close
|
52
|
+
@system.file_exists?(pathname).should == true
|
53
|
+
@system.dir_exists?(pathname).should == false
|
54
|
+
@system.dir_exists?(pathname.parent).should == true
|
55
|
+
children = @system.list(pathname.parent)
|
56
|
+
children.size.should == 1
|
57
|
+
children[0].should == pathname.basename.to_s
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'directory creation should leave file system consistent' do
|
61
|
+
pathname = Pathname.new('root/dir/sub')
|
62
|
+
@system.dir_exists?(pathname).should == false
|
63
|
+
@system.file_exists?(pathname).should == false
|
64
|
+
@system.dir_exists?(pathname.parent).should == false
|
65
|
+
@system.mkdir(pathname.parent.parent)
|
66
|
+
@system.mkdir(pathname.parent)
|
67
|
+
@system.mkdir(pathname)
|
68
|
+
@system.dir_exists?(pathname).should == true
|
69
|
+
@system.file_exists?(pathname).should == false
|
70
|
+
@system.dir_exists?(pathname.parent).should == true
|
71
|
+
list = @system.list(pathname.parent)
|
72
|
+
list.size.should == 1
|
73
|
+
list[0].should ==(pathname.basename.to_s)
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'read io should raise error if file does not exists' do
|
77
|
+
pathname = Pathname.new('dir/file.txt')
|
78
|
+
Proc.new {
|
79
|
+
@system.io(pathname, 'r')
|
80
|
+
}.should raise_error(Errno::ENOENT)
|
81
|
+
end
|
82
|
+
|
83
|
+
it 'delete dir' do
|
84
|
+
pathname = Pathname.new('dir')
|
85
|
+
@system.mkdir(pathname)
|
86
|
+
@system.delete_dir(pathname)
|
87
|
+
@system.dir_exists?(pathname).should == false
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'deleting dir that does not exist should raise error' do
|
91
|
+
pathname = Pathname.new('dir/dir2')
|
92
|
+
Proc.new {
|
93
|
+
@system.delete_dir(pathname)
|
94
|
+
}.should raise_error(Errno::ENOENT)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'copy file' do
|
98
|
+
pathname = Pathname.new('file1')
|
99
|
+
write_io = load_io(pathname, 'w')
|
100
|
+
write_io.puts 'line'
|
101
|
+
write_io.close
|
102
|
+
target = Pathname.new('target')
|
103
|
+
@system.copy_file(pathname, target)
|
104
|
+
@system.file_exists?(target).should == true
|
105
|
+
read_io = load_io(target, 'r')
|
106
|
+
read_io.gets.should == "line\n"
|
107
|
+
read_io.close
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'move file' do
|
111
|
+
pathname = Pathname.new('file1')
|
112
|
+
write_content(pathname, 'line')
|
113
|
+
target = Pathname.new('target')
|
114
|
+
@system.move_file(pathname, target)
|
115
|
+
@system.file_exists?(target).should == true
|
116
|
+
read_io = load_io(target, 'r')
|
117
|
+
read_io.gets.should == "line\n"
|
118
|
+
read_io.close
|
119
|
+
@system.file_exists?(pathname).should == false
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'move dir' do
|
123
|
+
source = Pathname.new('source')
|
124
|
+
@system.mkdir source
|
125
|
+
source_file = Pathname.new('source/file.txt')
|
126
|
+
write_content(source_file, 'file.txt')
|
127
|
+
@system.mkdir source.join('subdir')
|
128
|
+
target = Pathname.new('target')
|
129
|
+
@system.move_dir(source, target)
|
130
|
+
@system.list(target).size.should == 2
|
131
|
+
@system.dir_exists?(source).should == false
|
132
|
+
@system.dir_exists?(target).should == true
|
133
|
+
@system.file_exists?(Pathname.new('target/file.txt')).should == true
|
134
|
+
@system.dir_exists?(Pathname.new('target/subdir')).should == true
|
135
|
+
end
|
136
|
+
|
137
|
+
it 'copy dir' do
|
138
|
+
source = Pathname.new('source')
|
139
|
+
@system.mkdir source
|
140
|
+
source_file = Pathname.new('source/file.txt')
|
141
|
+
write_content(source_file, 'file.txt')
|
142
|
+
@system.mkdir source.join('subdir')
|
143
|
+
target = Pathname.new('target')
|
144
|
+
@system.copy_dir(source, target)
|
145
|
+
@system.list(target).size.should == 2
|
146
|
+
@system.dir_exists?(source).should == true
|
147
|
+
@system.dir_exists?(target).should == true
|
148
|
+
@system.file_exists?(Pathname.new('target/file.txt')).should == true
|
149
|
+
end
|
150
|
+
|
151
|
+
def write_content(pathname, content)
|
152
|
+
write_io = load_io(pathname, 'w')
|
153
|
+
write_io.puts content
|
154
|
+
write_io.close
|
155
|
+
end
|
156
|
+
|
157
|
+
def load_io(*args)
|
158
|
+
io = @system.io(*args)
|
159
|
+
if (io)
|
160
|
+
@ios.push(io)
|
161
|
+
else
|
162
|
+
raise "IO is null for: #{args}"
|
163
|
+
end
|
164
|
+
return io
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
@@ -5,15 +5,15 @@ $:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'buildmast
|
|
5
5
|
require 'cotta/command_interface'
|
6
6
|
|
7
7
|
module BuildMaster
|
8
|
-
|
9
|
-
|
8
|
+
describe CommandInterface do
|
9
|
+
it 'delegate output to io' do
|
10
10
|
io = mock('io')
|
11
11
|
io.should_receive(:puts).with('content to output')
|
12
12
|
interface = CommandInterface.new(io)
|
13
13
|
interface.puts('content to output')
|
14
14
|
end
|
15
15
|
|
16
|
-
|
16
|
+
it 'prompt outputs a message and get the response from io' do
|
17
17
|
io = mock('io')
|
18
18
|
io.should_receive(:puts).with('question')
|
19
19
|
io.should_receive(:gets).and_return('answer')
|
@@ -22,7 +22,7 @@ context 'command line interface' do
|
|
22
22
|
actual.should == 'answer'
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
it 'prompt for choice' do
|
26
26
|
io = mock('io')
|
27
27
|
io.should_receive(:puts).once.with('select one of the following')
|
28
28
|
io.should_receive(:puts).once.with('[1] item one')
|
@@ -33,14 +33,14 @@ context 'command line interface' do
|
|
33
33
|
actual.should == 'item two'
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
it 'prompt for choice returns nil for invalid choice' do
|
37
37
|
io = mock('io')
|
38
38
|
io.should_receive(:puts).with('select one')
|
39
39
|
io.should_receive(:puts).exactly(2).times
|
40
40
|
io.should_receive(:gets).and_return('9')
|
41
41
|
interface = CommandInterface.new(io)
|
42
42
|
actual = interface.prompt_for_choice('select one', ['one', 'two'])
|
43
|
-
actual.
|
43
|
+
actual.should be_nil
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -5,18 +5,18 @@ require 'cotta/command_runner'
|
|
5
5
|
require 'cotta/command_error'
|
6
6
|
|
7
7
|
module BuildMaster
|
8
|
-
|
9
|
-
|
8
|
+
describe CommandRunner do
|
9
|
+
it 'return content' do
|
10
10
|
runner = CommandRunner.new('ruby --version')
|
11
11
|
runner.execute[0..3].should == 'ruby'
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
it 'raise error on abnormal exits' do
|
15
15
|
runner = CommandRunner.new('ruby ----')
|
16
|
-
Proc.new{runner.execute}.
|
16
|
+
Proc.new{runner.execute}.should raise_error(CommandError)
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
it 'take closure as io processor' do
|
20
20
|
runner = CommandRunner.new('echo test')
|
21
21
|
message_logged = nil
|
22
22
|
runner.execute {|io| message_logged = io.gets}
|
@@ -7,14 +7,14 @@ require 'cotta/in_memory_system'
|
|
7
7
|
|
8
8
|
module BuildMaster
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
describe 'Cotta' do
|
11
|
+
before do
|
12
12
|
# Given
|
13
13
|
@system = InMemorySystem.new
|
14
14
|
@cotta = Cotta.new(@system)
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
it 'shell out command to system' do
|
18
18
|
# Given
|
19
19
|
# When
|
20
20
|
@system.output_for_command('shell command', 'test')
|
@@ -24,32 +24,32 @@ context 'Cotta' do
|
|
24
24
|
@system.executed_commands[0].should == 'shell command'
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
it 'instantiate dir from cotta' do
|
28
28
|
dir = @cotta.dir('dirname')
|
29
29
|
dir.name.should == 'dirname'
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
it 'instantiate file from cotta' do
|
33
33
|
file = @cotta.file('one/two/three.txt')
|
34
34
|
file.name.should == 'three.txt'
|
35
35
|
file.parent.name.should == 'two'
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
it 'entry creates file or directory based on which one exists' do
|
39
39
|
@cotta.file('file').save
|
40
40
|
@cotta.dir('dir').mkdirs
|
41
41
|
@cotta.entry('file').exists?.should == true
|
42
42
|
@cotta.entry('dir').exists?.should == true
|
43
43
|
end
|
44
44
|
|
45
|
-
|
46
|
-
@cotta.file(nil).
|
47
|
-
@cotta.dir(nil).
|
48
|
-
Cotta.file(nil).
|
49
|
-
Cotta.dir(nil).
|
45
|
+
it 'nil in, nil out' do
|
46
|
+
@cotta.file(nil).should be_nil
|
47
|
+
@cotta.dir(nil).should be_nil
|
48
|
+
Cotta.file(nil).should be_nil
|
49
|
+
Cotta.dir(nil).should be_nil
|
50
50
|
end
|
51
51
|
|
52
|
-
|
52
|
+
it 'create parent directory directly from __FILE__' do
|
53
53
|
actual = BuildMaster::Cotta.parent_of(__FILE__)
|
54
54
|
actual.name.should == 'cotta'
|
55
55
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
$:.unshift File.dirname(__FILE__)
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'cotta_dir_behaviors'
|
4
4
|
|
5
5
|
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'buildmaster')
|
6
6
|
|
@@ -8,21 +8,21 @@ require 'spec'
|
|
8
8
|
require 'cotta/in_memory_system'
|
9
9
|
|
10
10
|
module BuildMaster
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
specify 'dir should not be equal if system different' do
|
18
|
-
(BuildMaster::CottaDir.new(InMemorySystem.new, Pathname.new('dir')) == @dir).should == false
|
19
|
-
end
|
20
|
-
|
21
|
-
specify 'to_s and inspect' do
|
22
|
-
file = CottaFile.new(@system, '/one/two/file.txt')
|
23
|
-
"#{file.to_s}".should == '/one/two/file.txt'
|
24
|
-
end
|
11
|
+
describe InMemorySystem, 'with Cotta Dir' do
|
12
|
+
it_should_behave_like 'CottaDirBehaviors'
|
13
|
+
|
14
|
+
def create_system
|
15
|
+
@system = InMemorySystem.new
|
16
|
+
end
|
25
17
|
|
26
|
-
|
27
|
-
|
18
|
+
it 'dir should not be equal if system different' do
|
19
|
+
(BuildMaster::CottaDir.new(InMemorySystem.new, Pathname.new('dir')) == @dir).should == false
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'to_s and inspect' do
|
23
|
+
file = CottaFile.new(@system, '/one/two/file.txt')
|
24
|
+
"#{file.to_s}".should == '/one/two/file.txt'
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
28
|
end
|
@@ -1,17 +1,17 @@
|
|
1
1
|
$:.unshift File.join(File.dirname(__FILE__))
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'cotta_dir_behaviors'
|
4
4
|
require 'physical_system_stub'
|
5
5
|
|
6
6
|
require 'spec'
|
7
7
|
|
8
8
|
module BuildMaster
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
describe PhysicalSystem, 'work with CottaDir' do
|
10
|
+
it_should_behave_like 'CottaDirBehaviors'
|
11
|
+
|
12
|
+
def create_system
|
12
13
|
@system = PhysicalSystemStub.new
|
13
14
|
end
|
14
15
|
|
15
|
-
register_cotta_dir_specifications
|
16
16
|
end
|
17
17
|
end
|
@@ -1,20 +1,19 @@
|
|
1
1
|
$:.unshift File.dirname(__FILE__)
|
2
2
|
|
3
|
-
require 'cotta_specifications'
|
4
3
|
require 'spec'
|
4
|
+
require 'cotta_file_behaviors'
|
5
5
|
|
6
6
|
$:.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib', 'buildmaster')
|
7
7
|
|
8
8
|
require 'cotta/in_memory_system'
|
9
9
|
|
10
10
|
module BuildMaster
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
register_cotta_file_specifications
|
11
|
+
describe InMemorySystem, 'with cotta file' do
|
12
|
+
it_should_behave_like 'CottaFileBehaviors'
|
13
|
+
|
14
|
+
def create_system
|
15
|
+
@system = InMemorySystem.new
|
16
|
+
end
|
18
17
|
|
19
|
-
end
|
18
|
+
end
|
20
19
|
end
|
@@ -1,19 +1,22 @@
|
|
1
1
|
$:.unshift File.dirname(__FILE__)
|
2
2
|
|
3
3
|
require 'spec'
|
4
|
-
require '
|
4
|
+
require 'cotta_file_behaviors'
|
5
5
|
require 'physical_system_stub'
|
6
6
|
|
7
7
|
module BuildMaster
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
describe PhysicalSystem, 'with cotta file' do
|
9
|
+
it_should_behave_like 'CottaFileBehaviors'
|
10
|
+
|
11
|
+
def create_system
|
11
12
|
@system = PhysicalSystemStub.new
|
12
13
|
end
|
13
|
-
|
14
|
-
register_cotta_file_specifications
|
15
14
|
|
16
|
-
|
15
|
+
before do
|
16
|
+
create_system unless @system
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'copying binary files properly' do
|
17
20
|
logo_gif = Cotta.parent_of(__FILE__).file('logo.gif')
|
18
21
|
content = logo_gif.read_binary {|io| io.read}
|
19
22
|
target = CottaFile.new(@system, Pathname.new('dir/logo.gif'))
|
@@ -26,7 +29,7 @@ context 'Cotta file with physical systeme' do
|
|
26
29
|
actual_stat.size.should == expected_stat.size
|
27
30
|
end
|
28
31
|
|
29
|
-
|
32
|
+
it 'zip and unzip' do
|
30
33
|
logo_gif = Cotta.parent_of(__FILE__).file('logo.gif')
|
31
34
|
content = logo_gif.read_binary {|io| io.read}
|
32
35
|
dir = CottaDir.new(@system, Pathname.new('dir'))
|