physique 0.3.10 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/FLUENT_MIGRATOR.md +300 -300
- data/Gemfile +3 -3
- data/Gemfile.lock +51 -11
- data/Guardfile +34 -0
- data/README.md +368 -368
- data/RUBY_SETUP.md +14 -14
- data/Rakefile +1 -1
- data/lib/physique.rb +22 -22
- data/lib/physique/config.rb +23 -23
- data/lib/physique/dsl.rb +46 -46
- data/lib/physique/project_path_resolver.rb +45 -45
- data/lib/physique/solution.rb +72 -72
- data/lib/physique/task_builders/build.rb +76 -69
- data/lib/physique/task_builders/default.rb +19 -19
- data/lib/physique/task_builders/fluent_migrator.rb +302 -299
- data/lib/physique/task_builders/nuget.rb +18 -6
- data/lib/physique/task_builders/octopus.rb +4 -2
- data/lib/physique/task_builders/publish_nugets.rb +5 -3
- data/lib/physique/task_builders/test.rb +4 -4
- data/lib/physique/tasks/fluent_migrator.rb +158 -158
- data/lib/physique/tasks/nugets_pack.rb +12 -12
- data/lib/physique/tasks/octopus_pack.rb +1 -1
- data/lib/physique/tasks/sqlcmd.rb +109 -109
- data/lib/physique/tasks/versionizer.rb +112 -112
- data/lib/physique/tasks_builder.rb +59 -59
- data/lib/physique/tool_locator.rb +50 -50
- data/lib/physique/version.rb +3 -3
- data/physique.gemspec +29 -28
- data/spec/fluent_migrator_config_spec.rb +39 -39
- data/spec/project_spec.rb +42 -42
- data/spec/publish_nugets_spec.rb +40 -40
- data/spec/solution_spec.rb +11 -11
- data/spec/sqlcmd_spec.rb +146 -146
- data/spec/support/shared_contexts/rake.rb +20 -21
- data/spec/task_builders/build_spec.rb +25 -25
- data/spec/task_builders/default_spec.rb +17 -17
- data/spec/task_builders/fluent_migrator_spec.rb +70 -68
- data/spec/task_builders/nspec_spec.rb +13 -13
- data/spec/task_builders/nuget_spec.rb +16 -16
- data/spec/test_data/solutions/.nuget/NuGet.Config +5 -5
- data/spec/test_data/solutions/.nuget/NuGet.exe +0 -0
- data/spec/test_data/solutions/.nuget/NuGet.targets +144 -144
- data/spec/test_data/solutions/.nuget/packages.config +3 -3
- data/spec/test_data/solutions/basic/.semver +6 -6
- data/spec/test_data/solutions/basic/Basic.Tests/Basic.Tests.csproj +58 -58
- data/spec/test_data/solutions/basic/Basic.Tests/Class1.cs +14 -14
- data/spec/test_data/solutions/basic/Basic.Tests/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/basic/Basic.Tests/packages.config +3 -3
- data/spec/test_data/solutions/basic/Basic.sln +28 -28
- data/spec/test_data/solutions/basic/Basic/Basic.csproj +52 -52
- data/spec/test_data/solutions/basic/Basic/Class1.cs +12 -12
- data/spec/test_data/solutions/basic/Basic/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/basic/Rakefile.rb +10 -10
- data/spec/test_data/solutions/basic/packages.config +3 -3
- data/spec/test_data/solutions/fluent-migrator/.semver +6 -6
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/Migrations/.gitkeep +0 -0
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/TestMigration.cs +19 -19
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/_Scripts/create.sql +1 -1
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/_Scripts/drop.sql +4 -4
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/_Scripts/seed.sql +1 -1
- data/spec/test_data/solutions/fluent-migrator/Basic.Migrations/packages.config +3 -3
- data/spec/test_data/solutions/fluent-migrator/Basic.Specs/Basic.Specs.csproj +59 -59
- data/spec/test_data/solutions/fluent-migrator/Basic.Specs/Class1.cs +12 -12
- data/spec/test_data/solutions/fluent-migrator/Basic.Specs/DebuggerShim.cs +42 -42
- data/spec/test_data/solutions/fluent-migrator/Basic.Specs/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/fluent-migrator/Basic.Specs/packages.config +3 -3
- data/spec/test_data/solutions/fluent-migrator/Basic.sln +39 -39
- data/spec/test_data/solutions/fluent-migrator/Basic/Basic.csproj +55 -55
- data/spec/test_data/solutions/fluent-migrator/Basic/Class1.cs +12 -12
- data/spec/test_data/solutions/fluent-migrator/Basic/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/fluent-migrator/Basic/packages.config +2 -2
- data/spec/test_data/solutions/fluent-migrator/Rakefile.rb +20 -20
- data/spec/test_data/solutions/multiple-fluent-migrator/.semver +6 -6
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Migrations1/Basic.Migrations1.csproj +52 -52
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Migrations1/Class1.cs +12 -12
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Migrations1/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Migrations2/Basic.Migrations2.csproj +52 -52
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Migrations2/Class1.cs +12 -12
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Migrations2/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Specs/Basic.Specs.csproj +59 -59
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Specs/Class1.cs +12 -12
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Specs/DebuggerShim.cs +42 -42
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Specs/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.Specs/packages.config +3 -3
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic.sln +45 -45
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic/Basic.csproj +55 -55
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic/Class1.cs +12 -12
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/multiple-fluent-migrator/Basic/packages.config +2 -2
- data/spec/test_data/solutions/multiple-fluent-migrator/Rakefile.rb +28 -28
- data/spec/test_data/solutions/nspec/.semver +6 -6
- data/spec/test_data/solutions/nspec/Basic.Specs/Basic.Specs.csproj +59 -59
- data/spec/test_data/solutions/nspec/Basic.Specs/Class1.cs +12 -12
- data/spec/test_data/solutions/nspec/Basic.Specs/DebuggerShim.cs +42 -42
- data/spec/test_data/solutions/nspec/Basic.Specs/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/nspec/Basic.Specs/packages.config +3 -3
- data/spec/test_data/solutions/nspec/Basic.sln +28 -28
- data/spec/test_data/solutions/nspec/Basic/Basic.csproj +55 -55
- data/spec/test_data/solutions/nspec/Basic/Class1.cs +12 -12
- data/spec/test_data/solutions/nspec/Basic/Properties/AssemblyInfo.cs +36 -36
- data/spec/test_data/solutions/nspec/Basic/packages.config +2 -2
- data/spec/test_data/solutions/nspec/Rakefile.rb +14 -14
- data/spec/test_data/tool_locator/Program Files/Microsoft SQL Server/110/Tools/Binn/SQLCMD.exe.txt b/data/spec/test_data/tool_locator/Program Files/Microsoft SQL → Server/110/Tools/Binn/SQLCMD.exe.txt +0 -0
- data/spec/test_data/tool_locator/Windows/Microsoft.NET/Framework/v3.5/MSBuild.exe.txt +0 -0
- data/spec/test_data/tool_locator/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe.txt +0 -0
- data/spec/tool_locator_spec.rb +27 -29
- metadata +33 -16
data/spec/publish_nugets_spec.rb
CHANGED
@@ -1,40 +1,40 @@
|
|
1
|
-
FEED_URL = 'https://www.nuget.org'
|
2
|
-
SYMBOLS_FEED_URL = 'http://nuget.gw.symbolsource.org/Public/NuGet'
|
3
|
-
|
4
|
-
describe Physique::PublishNugetsConfig do
|
5
|
-
let(:config) { Physique::PublishNugetsConfig.new }
|
6
|
-
let(:opts) { config.opts }
|
7
|
-
|
8
|
-
describe 'when setting feed data directly' do
|
9
|
-
let(:first_feed) { opts.feeds[0] }
|
10
|
-
|
11
|
-
it 'should create a default feed and delegate its configuration' do
|
12
|
-
config.feed_url = FEED_URL
|
13
|
-
config.symbols_feed_url = SYMBOLS_FEED_URL
|
14
|
-
|
15
|
-
opts.feeds.count.should eq(1)
|
16
|
-
|
17
|
-
first_feed.name.should eq('default')
|
18
|
-
first_feed.feed_url.should eq(FEED_URL)
|
19
|
-
first_feed.symbols_feed_url.should eq(SYMBOLS_FEED_URL)
|
20
|
-
first_feed.gen_symbols.should be_true
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
describe Physique::PublishNugetsFeedConfig do
|
26
|
-
let(:config) { Physique::PublishNugetsFeedConfig.new }
|
27
|
-
let(:feed) { config.opts }
|
28
|
-
|
29
|
-
it 'should set opts values' do
|
30
|
-
config.name = 'default'
|
31
|
-
config.feed_url = FEED_URL
|
32
|
-
config.symbols_feed_url = SYMBOLS_FEED_URL
|
33
|
-
config.api_key = 'API_KEY'
|
34
|
-
|
35
|
-
feed.name.should eq('default')
|
36
|
-
feed.feed_url.should eq(FEED_URL)
|
37
|
-
feed.symbols_feed_url.should eq(SYMBOLS_FEED_URL)
|
38
|
-
feed.gen_symbols.should be_true
|
39
|
-
end
|
40
|
-
end
|
1
|
+
FEED_URL = 'https://www.nuget.org'
|
2
|
+
SYMBOLS_FEED_URL = 'http://nuget.gw.symbolsource.org/Public/NuGet'
|
3
|
+
|
4
|
+
describe Physique::PublishNugetsConfig do
|
5
|
+
let(:config) { Physique::PublishNugetsConfig.new }
|
6
|
+
let(:opts) { config.opts }
|
7
|
+
|
8
|
+
describe 'when setting feed data directly' do
|
9
|
+
let(:first_feed) { opts.feeds[0] }
|
10
|
+
|
11
|
+
it 'should create a default feed and delegate its configuration' do
|
12
|
+
config.feed_url = FEED_URL
|
13
|
+
config.symbols_feed_url = SYMBOLS_FEED_URL
|
14
|
+
|
15
|
+
opts.feeds.count.should eq(1)
|
16
|
+
|
17
|
+
first_feed.name.should eq('default')
|
18
|
+
first_feed.feed_url.should eq(FEED_URL)
|
19
|
+
first_feed.symbols_feed_url.should eq(SYMBOLS_FEED_URL)
|
20
|
+
first_feed.gen_symbols.should be_true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe Physique::PublishNugetsFeedConfig do
|
26
|
+
let(:config) { Physique::PublishNugetsFeedConfig.new }
|
27
|
+
let(:feed) { config.opts }
|
28
|
+
|
29
|
+
it 'should set opts values' do
|
30
|
+
config.name = 'default'
|
31
|
+
config.feed_url = FEED_URL
|
32
|
+
config.symbols_feed_url = SYMBOLS_FEED_URL
|
33
|
+
config.api_key = 'API_KEY'
|
34
|
+
|
35
|
+
feed.name.should eq('default')
|
36
|
+
feed.feed_url.should eq(FEED_URL)
|
37
|
+
feed.symbols_feed_url.should eq(SYMBOLS_FEED_URL)
|
38
|
+
feed.gen_symbols.should be_true
|
39
|
+
end
|
40
|
+
end
|
data/spec/solution_spec.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
require 'physique'
|
2
|
-
|
3
|
-
describe Physique::CompileConfig do
|
4
|
-
|
5
|
-
describe 'By default' do
|
6
|
-
before(:all) { @config = Physique::CompileConfig.new }
|
7
|
-
|
8
|
-
it 'should set the build configuration to Release' do
|
9
|
-
expect(@config.opts.configuration).to eq('Release')
|
10
|
-
end
|
11
|
-
end
|
1
|
+
require 'physique'
|
2
|
+
|
3
|
+
describe Physique::CompileConfig do
|
4
|
+
|
5
|
+
describe 'By default' do
|
6
|
+
before(:all) { @config = Physique::CompileConfig.new }
|
7
|
+
|
8
|
+
it 'should set the build configuration to Release' do
|
9
|
+
expect(@config.opts.configuration).to eq('Release')
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
data/spec/sqlcmd_spec.rb
CHANGED
@@ -1,146 +1,146 @@
|
|
1
|
-
require 'physique'
|
2
|
-
require 'physique/tasks/sqlcmd'
|
3
|
-
|
4
|
-
describe Physique::SqlCmd::Config do
|
5
|
-
if ::Rake::Win32.windows?
|
6
|
-
describe 'When initialized with the minimum required values' do
|
7
|
-
before(:all) do
|
8
|
-
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
9
|
-
c.server_name = 'server'
|
10
|
-
c.command = 'command'
|
11
|
-
}.opts
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'should find sqlcmd tool' do
|
15
|
-
expect(@opts[:exe]).to match(/sqlcmd/i)
|
16
|
-
end
|
17
|
-
|
18
|
-
it 'should break on errors' do
|
19
|
-
expect(@opts[:continue_on_errors]).to be_false
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'should set the server name' do
|
23
|
-
expect(@opts[:server_name]).to eq('server')
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe 'When initialized with a command' do
|
28
|
-
before(:all) do
|
29
|
-
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
30
|
-
c.server_name = 'server'
|
31
|
-
c.command = 'command'
|
32
|
-
}.opts
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'should set the command' do
|
36
|
-
expect(@opts[:command]).to eq('command')
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should set the source to :command' do
|
40
|
-
expect(@opts[:source]).to eq(:command)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe 'When initialized with a file' do
|
45
|
-
before(:all) do
|
46
|
-
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
47
|
-
c.server_name = 'server'
|
48
|
-
c.file = 'test.sql'
|
49
|
-
}.opts
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'should set the file' do
|
53
|
-
expect(@opts[:file]).to eq('test.sql')
|
54
|
-
end
|
55
|
-
|
56
|
-
it 'should set the source to :file' do
|
57
|
-
expect(@opts[:source]).to eq(:file)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe 'When initialized with both a file and a command' do
|
62
|
-
before(:all) do
|
63
|
-
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
64
|
-
c.server_name = 'server'
|
65
|
-
c.command = 'command'
|
66
|
-
c.file = 'file'
|
67
|
-
}.opts
|
68
|
-
end
|
69
|
-
|
70
|
-
it 'should give precedence to the command' do
|
71
|
-
expect(@opts[:source]).to eq(:command)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
describe Physique::SqlCmd::Cmd do
|
78
|
-
describe 'When configured with a file' do
|
79
|
-
before(:all) do
|
80
|
-
opts = Physique::SqlCmd::Config.new.tap { |c|
|
81
|
-
c.server_name = 'server'
|
82
|
-
c.database_name = 'database'
|
83
|
-
c.file = 'test.sql'
|
84
|
-
}.opts
|
85
|
-
|
86
|
-
@cmd = Physique::SqlCmd::Cmd.new opts
|
87
|
-
end
|
88
|
-
|
89
|
-
it 'should break on errors' do
|
90
|
-
expect(@cmd.parameters).to include('-b')
|
91
|
-
end
|
92
|
-
|
93
|
-
it 'should include the server name' do
|
94
|
-
expect(@cmd.parameters).to include('-S server')
|
95
|
-
end
|
96
|
-
|
97
|
-
it 'should include the database name' do
|
98
|
-
expect(@cmd.parameters).to include('-d database')
|
99
|
-
end
|
100
|
-
|
101
|
-
it 'should include the file name' do
|
102
|
-
expect(@cmd.parameters).to include('-i test.sql')
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
describe 'When configured with a command' do
|
107
|
-
before(:all) do
|
108
|
-
opts = Physique::SqlCmd::Config.new.tap { |c|
|
109
|
-
c.server_name = 'server'
|
110
|
-
c.command = 'command'
|
111
|
-
}.opts
|
112
|
-
|
113
|
-
@cmd = Physique::SqlCmd::Cmd.new opts
|
114
|
-
end
|
115
|
-
|
116
|
-
it 'should break on errors' do
|
117
|
-
expect(@cmd.parameters).to include('-b')
|
118
|
-
end
|
119
|
-
|
120
|
-
it 'should include the server name' do
|
121
|
-
expect(@cmd.parameters).to include('-S server')
|
122
|
-
end
|
123
|
-
|
124
|
-
it 'should include the command in double quotes' do
|
125
|
-
expect(@cmd.parameters).to include('-Q "command"')
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
describe 'When setting variables' do
|
130
|
-
before(:all) do
|
131
|
-
opts = Physique::SqlCmd::Config.new.tap { |c|
|
132
|
-
c.server_name = 'server'
|
133
|
-
c.command = 'command'
|
134
|
-
c.set_variable 'test_variable1', 'test_value1'
|
135
|
-
c.set_variable 'test_variable2', 'test_value2'
|
136
|
-
}.opts
|
137
|
-
|
138
|
-
@cmd = Physique::SqlCmd::Cmd.new opts
|
139
|
-
end
|
140
|
-
|
141
|
-
it 'should add multiple variables to the command line' do
|
142
|
-
expect(@cmd.parameters).to include('-v test_variable1=test_value1')
|
143
|
-
expect(@cmd.parameters).to include('-v test_variable2=test_value2')
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
1
|
+
require 'physique'
|
2
|
+
require 'physique/tasks/sqlcmd'
|
3
|
+
|
4
|
+
describe Physique::SqlCmd::Config do
|
5
|
+
if ::Rake::Win32.windows?
|
6
|
+
describe 'When initialized with the minimum required values' do
|
7
|
+
before(:all) do
|
8
|
+
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
9
|
+
c.server_name = 'server'
|
10
|
+
c.command = 'command'
|
11
|
+
}.opts
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should find sqlcmd tool' do
|
15
|
+
expect(@opts[:exe]).to match(/sqlcmd/i)
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should break on errors' do
|
19
|
+
expect(@opts[:continue_on_errors]).to be_false
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should set the server name' do
|
23
|
+
expect(@opts[:server_name]).to eq('server')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe 'When initialized with a command' do
|
28
|
+
before(:all) do
|
29
|
+
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
30
|
+
c.server_name = 'server'
|
31
|
+
c.command = 'command'
|
32
|
+
}.opts
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should set the command' do
|
36
|
+
expect(@opts[:command]).to eq('command')
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should set the source to :command' do
|
40
|
+
expect(@opts[:source]).to eq(:command)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe 'When initialized with a file' do
|
45
|
+
before(:all) do
|
46
|
+
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
47
|
+
c.server_name = 'server'
|
48
|
+
c.file = 'test.sql'
|
49
|
+
}.opts
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'should set the file' do
|
53
|
+
expect(@opts[:file]).to eq('test.sql')
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should set the source to :file' do
|
57
|
+
expect(@opts[:source]).to eq(:file)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe 'When initialized with both a file and a command' do
|
62
|
+
before(:all) do
|
63
|
+
@opts = Physique::SqlCmd::Config.new.tap { |c|
|
64
|
+
c.server_name = 'server'
|
65
|
+
c.command = 'command'
|
66
|
+
c.file = 'file'
|
67
|
+
}.opts
|
68
|
+
end
|
69
|
+
|
70
|
+
it 'should give precedence to the command' do
|
71
|
+
expect(@opts[:source]).to eq(:command)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe Physique::SqlCmd::Cmd do
|
78
|
+
describe 'When configured with a file' do
|
79
|
+
before(:all) do
|
80
|
+
opts = Physique::SqlCmd::Config.new.tap { |c|
|
81
|
+
c.server_name = 'server'
|
82
|
+
c.database_name = 'database'
|
83
|
+
c.file = 'test.sql'
|
84
|
+
}.opts
|
85
|
+
|
86
|
+
@cmd = Physique::SqlCmd::Cmd.new opts
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'should break on errors' do
|
90
|
+
expect(@cmd.parameters).to include('-b')
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'should include the server name' do
|
94
|
+
expect(@cmd.parameters).to include('-S server')
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'should include the database name' do
|
98
|
+
expect(@cmd.parameters).to include('-d database')
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'should include the file name' do
|
102
|
+
expect(@cmd.parameters).to include('-i test.sql')
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
describe 'When configured with a command' do
|
107
|
+
before(:all) do
|
108
|
+
opts = Physique::SqlCmd::Config.new.tap { |c|
|
109
|
+
c.server_name = 'server'
|
110
|
+
c.command = 'command'
|
111
|
+
}.opts
|
112
|
+
|
113
|
+
@cmd = Physique::SqlCmd::Cmd.new opts
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'should break on errors' do
|
117
|
+
expect(@cmd.parameters).to include('-b')
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'should include the server name' do
|
121
|
+
expect(@cmd.parameters).to include('-S server')
|
122
|
+
end
|
123
|
+
|
124
|
+
it 'should include the command in double quotes' do
|
125
|
+
expect(@cmd.parameters).to include('-Q "command"')
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe 'When setting variables' do
|
130
|
+
before(:all) do
|
131
|
+
opts = Physique::SqlCmd::Config.new.tap { |c|
|
132
|
+
c.server_name = 'server'
|
133
|
+
c.command = 'command'
|
134
|
+
c.set_variable 'test_variable1', 'test_value1'
|
135
|
+
c.set_variable 'test_variable2', 'test_value2'
|
136
|
+
}.opts
|
137
|
+
|
138
|
+
@cmd = Physique::SqlCmd::Cmd.new opts
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'should add multiple variables to the command line' do
|
142
|
+
expect(@cmd.parameters).to include('-v test_variable1=test_value1')
|
143
|
+
expect(@cmd.parameters).to include('-v test_variable2=test_value2')
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -1,21 +1,20 @@
|
|
1
|
-
require 'rake'
|
2
|
-
|
3
|
-
shared_context 'rake' do
|
4
|
-
let(:rake) { Rake::Application.new }
|
5
|
-
let(:solution_name) { self.class.top_level_description }
|
6
|
-
let(:solution_dir) { "spec/test_data/solutions/#{solution_name}" }
|
7
|
-
let(:task_names) { rake.tasks.map{|t| t.name } }
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
Rake.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
shared_context 'rake' do
|
4
|
+
let(:rake) { Rake::Application.new }
|
5
|
+
let(:solution_name) { self.class.top_level_description }
|
6
|
+
let(:solution_dir) { "spec/test_data/solutions/#{solution_name}" }
|
7
|
+
let(:task_names) { rake.tasks.map{|t| t.name } }
|
8
|
+
|
9
|
+
before do
|
10
|
+
@original_app = Rake.application
|
11
|
+
Dir.chdir(solution_dir)
|
12
|
+
Rake.application = rake
|
13
|
+
Rake.load_rakefile('Rakefile.rb')
|
14
|
+
end
|
15
|
+
|
16
|
+
after do
|
17
|
+
Rake.application = @original_app
|
18
|
+
Dir.chdir(@original_app.original_dir)
|
19
|
+
end
|
20
|
+
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
require 'support/shared_contexts/rake'
|
2
|
-
|
3
|
-
describe 'basic' do
|
4
|
-
include_context 'rake'
|
5
|
-
|
6
|
-
let(:build_tasks) { %w(versionizer compile compile:clean compile:build compile:rebuild) }
|
7
|
-
|
8
|
-
it 'should create the build tasks' do
|
9
|
-
build_tasks.each do |name|
|
10
|
-
task_names.should include(name)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe 'the compile task' do
|
15
|
-
let(:task) { rake['compile'] }
|
16
|
-
|
17
|
-
it 'should run without error' do
|
18
|
-
task.invoke
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'should include restore as a prerequisite' do
|
22
|
-
task.prerequisites.should include('restore')
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
1
|
+
require 'support/shared_contexts/rake'
|
2
|
+
|
3
|
+
describe 'basic' do
|
4
|
+
include_context 'rake'
|
5
|
+
|
6
|
+
let(:build_tasks) { %w(versionizer compile compile:clean compile:build compile:rebuild) }
|
7
|
+
|
8
|
+
it 'should create the build tasks' do
|
9
|
+
build_tasks.each do |name|
|
10
|
+
task_names.should include(name)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'the compile task' do
|
15
|
+
let(:task) { rake['compile'] }
|
16
|
+
|
17
|
+
it 'should run without error' do
|
18
|
+
task.invoke
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should include restore as a prerequisite' do
|
22
|
+
task.prerequisites.should include('restore')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|