albacore 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -7
- data/README.markdown +0 -33
- data/VERSION +1 -1
- metadata +84 -91
- data/spec/albacoremodel_spec.rb +0 -53
- data/spec/assemblyinfo_spec.rb +0 -541
- data/spec/attrmethods_spec.rb +0 -136
- data/spec/config_spec.rb +0 -34
- data/spec/createtask_spec.rb +0 -236
- data/spec/csc_spec.rb +0 -253
- data/spec/docu_spec.rb +0 -109
- data/spec/exec_spec.rb +0 -45
- data/spec/fluentmigratorrunner_spec.rb +0 -254
- data/spec/msbuild_spec.rb +0 -215
- data/spec/mspec_spec.rb +0 -28
- data/spec/mstesttestrunner_spec.rb +0 -142
- data/spec/nant_spec.rb +0 -110
- data/spec/nchurn_spec.rb +0 -75
- data/spec/ncoverconsole_spec.rb +0 -353
- data/spec/ncoverreport_spec.rb +0 -619
- data/spec/ndepend_spec.rb +0 -72
- data/spec/nunittestrunner_spec.rb +0 -122
- data/spec/nuspec_spec.rb +0 -78
- data/spec/output_spec.rb +0 -117
- data/spec/patches/docu_patch.rb +0 -13
- data/spec/patches/fail_patch.rb +0 -9
- data/spec/patches/system_patch.rb +0 -20
- data/spec/plink_spec.rb +0 -62
- data/spec/runcommand_spec.rb +0 -94
- data/spec/spec_helper.rb +0 -17
- data/spec/specflowreport_spec.rb +0 -146
- data/spec/sqlcmd_spec.rb +0 -334
- data/spec/support/assemblyinfotester.rb +0 -51
- data/spec/support/ironruby_validator.rb +0 -26
- data/spec/support/msbuildtestdata.rb +0 -32
- data/spec/support/nanttestdata.rb +0 -33
- data/spec/support/ncoverconsoletestdata.rb +0 -20
- data/spec/support/ncoverreporttestdata.rb +0 -26
- data/spec/support/nokogiri_validator.rb +0 -15
- data/spec/support/outputtestdata.rb +0 -13
- data/spec/support/ziptestdata.rb +0 -13
- data/spec/unzip_spec.rb +0 -15
- data/spec/xbuild_spec.rb +0 -15
- data/spec/xunit_spec.rb +0 -168
- data/spec/yamlconfig_spec.rb +0 -49
- data/spec/zip_spec.rb +0 -104
data/spec/runcommand_spec.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/albacoretask'
|
3
|
-
require 'system_patch'
|
4
|
-
|
5
|
-
class RunCommandObject
|
6
|
-
include Albacore::Task
|
7
|
-
include Albacore::RunCommand
|
8
|
-
|
9
|
-
def execute
|
10
|
-
result = run_command "Run Command Test Object"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe "when setting the command" do
|
15
|
-
before :all do
|
16
|
-
@runme = RunCommandObject.new
|
17
|
-
@runme.extend SystemPatch
|
18
|
-
|
19
|
-
@runme.command = "test.exe"
|
20
|
-
@runme.execute
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should execute the specified command, quoted" do
|
24
|
-
@runme.system_command.should == "\"test.exe\""
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "when specifying a parameter to a command" do
|
29
|
-
before :all do
|
30
|
-
@runme = RunCommandObject.new
|
31
|
-
@runme.extend SystemPatch
|
32
|
-
@runme.command = "test.exe"
|
33
|
-
@runme.parameters "param1"
|
34
|
-
@runme.execute
|
35
|
-
end
|
36
|
-
|
37
|
-
it "should separate the parameters from the command" do
|
38
|
-
@runme.system_command.should == "\"test.exe\" param1"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
describe "when specifying multiple parameters to a command" do
|
43
|
-
before :all do
|
44
|
-
@runme = RunCommandObject.new
|
45
|
-
@runme.extend SystemPatch
|
46
|
-
@runme.command = "test.exe"
|
47
|
-
@runme.parameters "param1", "param2", "param3"
|
48
|
-
@runme.execute
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should separate all parameters by a space" do
|
52
|
-
@runme.system_command.should == "\"test.exe\" param1 param2 param3"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe "when executing a runcommand object twice" do
|
57
|
-
before :all do
|
58
|
-
@runmeone = RunCommandObject.new
|
59
|
-
@runmetwo = @runmeone
|
60
|
-
@runmeone.extend SystemPatch
|
61
|
-
@runmeone.command = "test.exe"
|
62
|
-
@runmeone.parameters "1", "2", "3"
|
63
|
-
|
64
|
-
@runmeone.execute
|
65
|
-
@runmetwo.execute
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should only pass the parameters to the command once for the first execution" do
|
69
|
-
@runmeone.system_command.should == "\"test.exe\" 1 2 3"
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should only pass the parameters to the command once for the second execution" do
|
73
|
-
@runmetwo.system_command.should == "\"test.exe\" 1 2 3"
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe "when the command exists relative to the project root" do
|
78
|
-
before :all do
|
79
|
-
@runme = RunCommandObject.new
|
80
|
-
@runme.extend SystemPatch
|
81
|
-
|
82
|
-
File.open('test.exe', 'w') {}
|
83
|
-
@runme.command = "test.exe"
|
84
|
-
@runme.execute
|
85
|
-
end
|
86
|
-
|
87
|
-
after :all do
|
88
|
-
FileUtils.rm_f('test.exe')
|
89
|
-
end
|
90
|
-
|
91
|
-
it "should expand the path" do
|
92
|
-
@runme.system_command.should == "\"#{File.expand_path('test.exe')}\""
|
93
|
-
end
|
94
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
@root_dir = File.expand_path(File.join(File.dirname(__FILE__), "../"))
|
2
|
-
|
3
|
-
$: << './'
|
4
|
-
$: << File.join(@root_dir, "lib")
|
5
|
-
$: << File.join(@root_dir, "spec")
|
6
|
-
$: << File.join(@root_dir, "spec/patches")
|
7
|
-
$: << File.join(@root_dir, "spec/support")
|
8
|
-
$: << File.join(@root_dir, "lib/albacore/config")
|
9
|
-
|
10
|
-
require 'rubygems'
|
11
|
-
require 'spec'
|
12
|
-
require 'rake/tasklib'
|
13
|
-
require 'lib/albacore/support/createtask.rb'
|
14
|
-
require 'lib/albacore/config/config.rb'
|
15
|
-
require 'lib/albacore'
|
16
|
-
require 'system_patch'
|
17
|
-
require 'fail_patch'
|
data/spec/specflowreport_spec.rb
DELETED
@@ -1,146 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/specflowreport'
|
3
|
-
require 'albacore/nunittestrunner'
|
4
|
-
|
5
|
-
shared_examples_for "specflow paths" do
|
6
|
-
before :all do
|
7
|
-
@specflowpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'SpecFlow', 'specflow.exe')
|
8
|
-
@test_project = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'TestSolution', 'TestSolution.SpecFlow', 'TestSolution.SpecFlow.csproj')
|
9
|
-
@nunit_test_restuls = "/xmlTestResult:TestResult.xml"
|
10
|
-
@output_option = "/out:specs.html"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe SpecFlowReport, "when running without specifying command path" do
|
15
|
-
it_should_behave_like "specflow paths"
|
16
|
-
|
17
|
-
before :all do
|
18
|
-
@spec = SpecFlowReport.new()
|
19
|
-
@spec.projects @test_project
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should try to run in same folder" do
|
23
|
-
@spec.command.should eql('specflow.exe')
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe SpecFlowReport, "When not passing a project" do
|
28
|
-
|
29
|
-
before :all do
|
30
|
-
@spec = SpecFlowReport.new()
|
31
|
-
@spec.extend(FailPatch)
|
32
|
-
@spec.execute
|
33
|
-
$task_failed.should be_true
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should fail" do
|
37
|
-
$task_failed.should be_true
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe SpecFlowReport, "When passing a command" do
|
42
|
-
it_should_behave_like "specflow paths"
|
43
|
-
|
44
|
-
before :all do
|
45
|
-
@spec = SpecFlowReport.new("/path_to_command/")
|
46
|
-
@spec.projects @test_project
|
47
|
-
end
|
48
|
-
|
49
|
-
it "should not include specflow.exe" do
|
50
|
-
@spec.command.should eql('/path_to_command/')
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe SpecFlowReport, "When passing some options" do
|
55
|
-
it_should_behave_like "specflow paths"
|
56
|
-
before :all do
|
57
|
-
spec = SpecFlowReport.new()
|
58
|
-
spec.options @output_option
|
59
|
-
spec.projects @test_project
|
60
|
-
@command_line = spec.get_command_line
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should include the options in the command line" do
|
64
|
-
@command_line.should include(@output_option)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe SpecFlowReport, "When no options are passed" do
|
69
|
-
it_should_behave_like "specflow paths"
|
70
|
-
|
71
|
-
before :all do
|
72
|
-
spec = SpecFlowReport.new()
|
73
|
-
spec.projects @test_project
|
74
|
-
@command_line = spec.get_command_line
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should include sensible defaults" do
|
78
|
-
@command_line.should include("/xmlTestResult:TestResult.xml /out:specs.html")
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
describe SpecFlowReport, "When a report is specified" do
|
83
|
-
it_should_behave_like "specflow paths"
|
84
|
-
before :all do
|
85
|
-
@spec = SpecFlowReport.new()
|
86
|
-
@spec.report = 'assigned report'
|
87
|
-
@spec.projects @test_project
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should include the specified report in the command line" do
|
91
|
-
@spec.get_command_line.should include("assigned report")
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
describe SpecFlowReport, "When no report is specified" do
|
96
|
-
it_should_behave_like "specflow paths"
|
97
|
-
before :all do
|
98
|
-
@spec = SpecFlowReport.new()
|
99
|
-
@spec.projects @test_project
|
100
|
-
end
|
101
|
-
|
102
|
-
it "should include the nunit report in the command line" do
|
103
|
-
@spec.get_command_line.should include("nunitexecutionreport")
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe SpecFlowReport, "when configured correctly" do
|
108
|
-
it_should_behave_like "specflow paths"
|
109
|
-
|
110
|
-
before :all do
|
111
|
-
nunitpath = File.join(File.dirname(__FILE__), 'support', 'Tools', 'NUnit-v2.5', 'nunit-console-x86.exe')
|
112
|
-
test_assembly = File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'SpecFlow', 'TestSolution.SpecFlow.dll')
|
113
|
-
|
114
|
-
nunit = NUnitTestRunner.new(nunitpath)
|
115
|
-
nunit.extend(FailPatch)
|
116
|
-
nunit.assemblies test_assembly
|
117
|
-
nunit.options '/noshadow /out=TestResult.xml'
|
118
|
-
nunit.execute
|
119
|
-
|
120
|
-
spec = SpecFlowReport.new(@specflowpath)
|
121
|
-
spec.extend(FailPatch)
|
122
|
-
spec.projects @test_project
|
123
|
-
|
124
|
-
spec.execute
|
125
|
-
end
|
126
|
-
|
127
|
-
it "should execute" do
|
128
|
-
$task_failed.should be_false
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
describe SpecFlowReport, "when providing configuration" do
|
133
|
-
let :specflow do
|
134
|
-
Albacore.configure do |config|
|
135
|
-
config.specflowreport.command = "configured"
|
136
|
-
config.specflowreport.report = "configured report"
|
137
|
-
end
|
138
|
-
specflow = SpecFlowReport.new
|
139
|
-
end
|
140
|
-
|
141
|
-
it "should use the configured values" do
|
142
|
-
specflow.command.should == "configured"
|
143
|
-
specflow.report.should == "configured report"
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
data/spec/sqlcmd_spec.rb
DELETED
@@ -1,334 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'albacore/sqlcmd'
|
3
|
-
|
4
|
-
describe SQLCmd, "when running a script the easy way" do
|
5
|
-
before :all do
|
6
|
-
@cmd = SQLCmd.new
|
7
|
-
@cmd.log_level = :verbose
|
8
|
-
@cmd.extend(SystemPatch)
|
9
|
-
@cmd.disable_system = true
|
10
|
-
|
11
|
-
@cmd.scripts "somescript.sql"
|
12
|
-
|
13
|
-
@cmd.execute
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should use localhost as server default" do
|
17
|
-
@cmd.system_command.should include("-S \".\"")
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should have no database designation (because it could be embedded in the sql file)" do
|
21
|
-
@cmd.system_command.should_not include("-d")
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should use integrated security instead of username/password" do
|
25
|
-
@cmd.system_command.should include("-E")
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should not include username" do
|
29
|
-
@cmd.system_command.should_not include("-U")
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should not include password" do
|
33
|
-
@cmd.system_command.should_not include("-P")
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should find the location of the sqlcmd exe for the user" do
|
37
|
-
@cmd.system_command.downcase.should include("sqlcmd.exe")
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should specify the script file" do
|
41
|
-
@cmd.system_command.should include("-i \"somescript.sql\"")
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should not contain the -b option" do
|
45
|
-
@cmd.system_command.should_not include("-b")
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
describe SQLCmd, "when turning off trusted_connection" do
|
50
|
-
before :all do
|
51
|
-
@cmd = SQLCmd.new
|
52
|
-
@cmd.log_level = :verbose
|
53
|
-
@cmd.extend(SystemPatch)
|
54
|
-
@cmd.disable_system = true
|
55
|
-
|
56
|
-
@cmd.scripts "somescript.sql"
|
57
|
-
@cmd.trusted_connection = false
|
58
|
-
|
59
|
-
@cmd.execute
|
60
|
-
end
|
61
|
-
|
62
|
-
it "should not specify the -E option" do
|
63
|
-
@cmd.system_command.should_not include("-E")
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
describe SQLCmd, "when using a trusted connection with a username and password" do
|
68
|
-
before :all do
|
69
|
-
@cmd = SQLCmd.new
|
70
|
-
@cmd.log_level = :verbose
|
71
|
-
@cmd.extend(SystemPatch)
|
72
|
-
@cmd.disable_system = true
|
73
|
-
|
74
|
-
@cmd.scripts "somescript.sql"
|
75
|
-
@cmd.trusted_connection = true
|
76
|
-
@cmd.username = "user"
|
77
|
-
@cmd.password = "password"
|
78
|
-
|
79
|
-
@cmd.execute
|
80
|
-
end
|
81
|
-
|
82
|
-
it "should override the trusted connection and not specify the -E option" do
|
83
|
-
@cmd.system_command.should_not include("-E")
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should specify the username" do
|
87
|
-
@cmd.system_command.should include("-U \"user\"")
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should specify the password" do
|
91
|
-
@cmd.system_command.should include("-P \"password\"")
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
describe SQLCmd, "when running a script file against a database with authentication information" do
|
96
|
-
before :all do
|
97
|
-
@cmd = SQLCmd.new
|
98
|
-
@cmd.command = "sqlcmd.exe"
|
99
|
-
@cmd.log_level = :verbose
|
100
|
-
@cmd.extend(SystemPatch)
|
101
|
-
@cmd.disable_system = true
|
102
|
-
|
103
|
-
@cmd.server="a server"
|
104
|
-
@cmd.database="a database"
|
105
|
-
@cmd.username="some user"
|
106
|
-
@cmd.password="shh! it's a secret!"
|
107
|
-
@cmd.scripts "somescript.sql"
|
108
|
-
|
109
|
-
@cmd.execute
|
110
|
-
end
|
111
|
-
|
112
|
-
it "should specify the location of the sqlcmd exe" do
|
113
|
-
@cmd.system_command.downcase.should include("sqlcmd.exe")
|
114
|
-
end
|
115
|
-
|
116
|
-
it "should specify the script file" do
|
117
|
-
@cmd.system_command.should include("-i \"somescript.sql\"")
|
118
|
-
end
|
119
|
-
|
120
|
-
it "should specify the server" do
|
121
|
-
@cmd.system_command.should include("-S \"a server\"")
|
122
|
-
end
|
123
|
-
|
124
|
-
it "should specify the database" do
|
125
|
-
@cmd.system_command.should include("-d \"a database\"")
|
126
|
-
end
|
127
|
-
|
128
|
-
it "should specify the username" do
|
129
|
-
@cmd.system_command.should include("-U \"some user\"")
|
130
|
-
end
|
131
|
-
|
132
|
-
it "should specify the password" do
|
133
|
-
@cmd.system_command.should include("-P \"shh! it's a secret!\"")
|
134
|
-
end
|
135
|
-
|
136
|
-
it "should not contain the -b option" do
|
137
|
-
@cmd.system_command.should_not include("-b")
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
describe SQLCmd, "when running with no command path specified" do
|
142
|
-
before :all do
|
143
|
-
strio = StringIO.new
|
144
|
-
@cmd = SQLCmd.new
|
145
|
-
@cmd.log_level = :verbose
|
146
|
-
@cmd.log_device = strio
|
147
|
-
@cmd.extend(SystemPatch)
|
148
|
-
@cmd.extend(FailPatch)
|
149
|
-
@cmd.disable_system = true
|
150
|
-
|
151
|
-
@cmd.execute
|
152
|
-
@log_data = strio.string
|
153
|
-
|
154
|
-
@all_possible_sqlcmd_paths = []
|
155
|
-
|
156
|
-
["program files", "program files (x86)"].each do |program_files|
|
157
|
-
["90", "100"].each do |sql_version|
|
158
|
-
sqlcmd_path = File.join(ENV['SystemDrive'], program_files,'microsoft sql server', sql_version, 'tools','binn', 'sqlcmd.exe')
|
159
|
-
@all_possible_sqlcmd_paths << sqlcmd_path
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
it "should find sqlcmd in the standard places or bail" do
|
165
|
-
any_sqlcmd_exists = false
|
166
|
-
|
167
|
-
@all_possible_sqlcmd_paths.each do |sqlcmd_path|
|
168
|
-
sqlcmd_exists = File.exists?(sqlcmd_path)
|
169
|
-
any_sqlcmd_exists = true if sqlcmd_exists
|
170
|
-
$task_failed.should be_false if sqlcmd_exists
|
171
|
-
end
|
172
|
-
$task_failed.should be_true if any_sqlcmd_exists == false
|
173
|
-
end
|
174
|
-
|
175
|
-
it "should log a failure message if it cannot find sqlcmd in the standard places" do
|
176
|
-
any_sqlcmd_exists = false
|
177
|
-
|
178
|
-
@all_possible_sqlcmd_paths.each do |sqlcmd_path|
|
179
|
-
sqlcmd_exists = File.exists?(sqlcmd_path)
|
180
|
-
any_sqlcmd_exists = true if File.exists?(sqlcmd_path)
|
181
|
-
end
|
182
|
-
@log_data.should include('SQLCmd.command cannot be nil.') if any_sqlcmd_exists == false
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
describe SQLCmd, "when execution of sqlcmd fails" do
|
187
|
-
before :all do
|
188
|
-
strio = StringIO.new
|
189
|
-
@cmd = SQLCmd.new
|
190
|
-
@cmd.command="sqlcmd.exe"
|
191
|
-
@cmd.log_level = :verbose
|
192
|
-
@cmd.log_device = strio
|
193
|
-
@cmd.extend(SystemPatch)
|
194
|
-
@cmd.extend(FailPatch)
|
195
|
-
@cmd.disable_system = true
|
196
|
-
@cmd.force_system_failure = true
|
197
|
-
|
198
|
-
@cmd.execute
|
199
|
-
@log_data = strio.string
|
200
|
-
end
|
201
|
-
|
202
|
-
|
203
|
-
it "should fail" do
|
204
|
-
$task_failed.should be_true
|
205
|
-
end
|
206
|
-
|
207
|
-
it "should log a failure message" do
|
208
|
-
@log_data.should include('SQLCmd Failed. See Build Log For Detail.')
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
describe SQLCmd, "when running multiple script files" do
|
213
|
-
before :all do
|
214
|
-
@cmd = SQLCmd.new
|
215
|
-
@cmd.command = "sqlcmd.exe"
|
216
|
-
@cmd.log_level = :verbose
|
217
|
-
@cmd.extend(SystemPatch)
|
218
|
-
@cmd.disable_system = true
|
219
|
-
|
220
|
-
scriptnames = Array.new
|
221
|
-
scriptnames << "did you get.sql\r\n"
|
222
|
-
scriptnames << "that thing.sql"
|
223
|
-
scriptnames << "i sent you.sql\r\n"
|
224
|
-
@cmd.scripts = scriptnames
|
225
|
-
|
226
|
-
@cmd.execute
|
227
|
-
end
|
228
|
-
|
229
|
-
it "should specify the first script file" do
|
230
|
-
@cmd.system_command.should include("-i \"did you get.sql\"")
|
231
|
-
end
|
232
|
-
|
233
|
-
it "should specify the second script file" do
|
234
|
-
@cmd.system_command.should include("-i \"that thing.sql\"")
|
235
|
-
end
|
236
|
-
|
237
|
-
it "should specify the third script file" do
|
238
|
-
@cmd.system_command.should include("-i \"i sent you.sql\"")
|
239
|
-
end
|
240
|
-
|
241
|
-
it "should include the -b option" do
|
242
|
-
@cmd.system_command.should include("-b")
|
243
|
-
end
|
244
|
-
|
245
|
-
end
|
246
|
-
|
247
|
-
describe SQLCmd, "when running multiple script files with batch_abort set to false" do
|
248
|
-
before :all do
|
249
|
-
@cmd = SQLCmd.new
|
250
|
-
@cmd.command = "sqlcmd.exe"
|
251
|
-
@cmd.log_level = :verbose
|
252
|
-
@cmd.extend(SystemPatch)
|
253
|
-
@cmd.disable_system = true
|
254
|
-
@cmd.batch_abort = false
|
255
|
-
|
256
|
-
scriptnames = Array.new
|
257
|
-
scriptnames << "did you get.sql\r\n"
|
258
|
-
scriptnames << "that thing.sql"
|
259
|
-
scriptnames << "i sent you.sql\r\n"
|
260
|
-
@cmd.scripts = scriptnames
|
261
|
-
|
262
|
-
@cmd.execute
|
263
|
-
end
|
264
|
-
|
265
|
-
it "should specify the first script file" do
|
266
|
-
@cmd.system_command.should include("-i \"did you get.sql\"")
|
267
|
-
end
|
268
|
-
|
269
|
-
it "should specify the second script file" do
|
270
|
-
@cmd.system_command.should include("-i \"that thing.sql\"")
|
271
|
-
end
|
272
|
-
|
273
|
-
it "should specify the third script file" do
|
274
|
-
@cmd.system_command.should include("-i \"i sent you.sql\"")
|
275
|
-
end
|
276
|
-
|
277
|
-
it "should not include the -b option" do
|
278
|
-
@cmd.system_command.should_not include("-b")
|
279
|
-
end
|
280
|
-
|
281
|
-
end
|
282
|
-
|
283
|
-
describe SQLCmd, "when running with variables specified" do
|
284
|
-
before :all do
|
285
|
-
@cmd = SQLCmd.new
|
286
|
-
@cmd.command = "sqlcmd.exe"
|
287
|
-
@cmd.log_level = :verbose
|
288
|
-
@cmd.extend(SystemPatch)
|
289
|
-
@cmd.disable_system = true
|
290
|
-
@cmd.scripts "somescript.sql"
|
291
|
-
|
292
|
-
@cmd.variables :myvar => "my value", :another_var => :another_value
|
293
|
-
|
294
|
-
@cmd.execute
|
295
|
-
end
|
296
|
-
|
297
|
-
it "should supply the variables to sqlcmd" do
|
298
|
-
@cmd.system_command.should include("-v myvar=my value")
|
299
|
-
@cmd.system_command.should include("-v another_var=another_value")
|
300
|
-
end
|
301
|
-
end
|
302
|
-
|
303
|
-
describe SQLCmd, "when providing configuration" do
|
304
|
-
let :sqlcmd do
|
305
|
-
Albacore.configure do |config|
|
306
|
-
config.sqlcmd.command = "configured"
|
307
|
-
end
|
308
|
-
sqlcmd = SQLCmd.new
|
309
|
-
end
|
310
|
-
|
311
|
-
it "should use the configured values" do
|
312
|
-
sqlcmd.command.should == "configured"
|
313
|
-
end
|
314
|
-
end
|
315
|
-
|
316
|
-
describe SQLCmd, "when severity it set" do
|
317
|
-
before :all do
|
318
|
-
@cmd = SQLCmd.new
|
319
|
-
@cmd.extend(SystemPatch)
|
320
|
-
@cmd.disable_system = true
|
321
|
-
@cmd.scripts "somescript.sql"
|
322
|
-
|
323
|
-
@cmd.severity = 1
|
324
|
-
|
325
|
-
@cmd.execute
|
326
|
-
end
|
327
|
-
|
328
|
-
it "should have severity option set" do
|
329
|
-
@cmd.system_command.should include("-V")
|
330
|
-
end
|
331
|
-
it "should have severity set to correct value" do
|
332
|
-
@cmd.system_command.should include("-V \"1\"")
|
333
|
-
end
|
334
|
-
end
|