albacore 0.0.9 → 0.1.0

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.
Files changed (124) hide show
  1. data/README.markdown +84 -81
  2. data/VERSION +1 -1
  3. data/install_dependencies.rb +10 -10
  4. data/lib/albacore.rb +10 -2
  5. data/lib/albacore/assemblyinfo.rb +100 -100
  6. data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
  7. data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
  8. data/lib/albacore/docu.rb +39 -0
  9. data/lib/albacore/exec.rb +23 -0
  10. data/lib/albacore/expandtemplates.rb +73 -71
  11. data/lib/albacore/msbuild.rb +56 -61
  12. data/lib/albacore/mspectestrunner.rb +44 -42
  13. data/lib/albacore/nant.rb +39 -0
  14. data/lib/albacore/ncoverconsole.rb +68 -61
  15. data/lib/albacore/ncoverreport.rb +56 -55
  16. data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
  17. data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
  18. data/lib/albacore/ncoverreports/classfilter.rb +5 -5
  19. data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
  20. data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
  21. data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
  22. data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
  23. data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
  24. data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
  25. data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
  26. data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
  27. data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
  28. data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
  29. data/lib/albacore/ndepend.rb +35 -0
  30. data/lib/albacore/nunittestrunner.rb +36 -35
  31. data/lib/albacore/plink.rb +48 -0
  32. data/lib/albacore/sftp.rb +33 -31
  33. data/lib/albacore/sqlcmd.rb +54 -51
  34. data/lib/albacore/ssh.rb +35 -33
  35. data/lib/albacore/support/albacore_helper.rb +1 -4
  36. data/lib/albacore/support/attrmethods.rb +25 -0
  37. data/lib/albacore/support/failure.rb +17 -17
  38. data/lib/albacore/support/globalconfig.rb +6 -0
  39. data/lib/albacore/support/logging.rb +30 -28
  40. data/lib/albacore/support/runcommand.rb +41 -41
  41. data/lib/albacore/support/yamlconfig.rb +23 -27
  42. data/lib/albacore/unzip.rb +28 -0
  43. data/lib/albacore/xbuild.rb +54 -0
  44. data/lib/albacore/xunittestrunner.rb +40 -43
  45. data/lib/albacore/zipdirectory.rb +72 -63
  46. data/lib/rake/assemblyinfotask.rb +12 -11
  47. data/lib/rake/docutask.rb +17 -0
  48. data/lib/rake/exectask.rb +18 -0
  49. data/lib/rake/expandtemplatestask.rb +12 -11
  50. data/lib/rake/msbuildtask.rb +13 -12
  51. data/lib/rake/mspectask.rb +12 -11
  52. data/lib/rake/nanttask.rb +17 -0
  53. data/lib/rake/ncoverconsoletask.rb +12 -11
  54. data/lib/rake/ncoverreporttask.rb +12 -11
  55. data/lib/rake/ndependtask.rb +23 -0
  56. data/lib/rake/nunittask.rb +12 -11
  57. data/lib/rake/plinktask.rb +23 -0
  58. data/lib/rake/renametask.rb +15 -15
  59. data/lib/rake/sftptask.rb +11 -10
  60. data/lib/rake/sqlcmdtask.rb +13 -12
  61. data/lib/rake/sshtask.rb +11 -10
  62. data/lib/rake/support/albacoretask.rb +16 -15
  63. data/lib/rake/unziptask.rb +17 -0
  64. data/lib/rake/xbuildtask.rb +22 -0
  65. data/lib/rake/xunittask.rb +12 -11
  66. data/lib/rake/ziptask.rb +12 -11
  67. data/rakefile.rb +255 -204
  68. data/spec/assemblyinfo_spec.rb +426 -221
  69. data/spec/assemblyinfotask_spec.rb +21 -21
  70. data/spec/docu_spec.rb +70 -0
  71. data/spec/docutask_spec.rb +39 -0
  72. data/spec/exec_spec.rb +23 -0
  73. data/spec/exectask_spec.rb +31 -0
  74. data/spec/expandtemplates_spec.rb +149 -148
  75. data/spec/expandtemplatestask_spec.rb +21 -21
  76. data/spec/msbuild_spec.rb +150 -139
  77. data/spec/msbuildtask_spec.rb +21 -21
  78. data/spec/mspectask_spec.rb +21 -21
  79. data/spec/nant_spec.rb +101 -0
  80. data/spec/nanttask_spec.rb +31 -0
  81. data/spec/ncoverconsole_spec.rb +253 -221
  82. data/spec/ncoverconsoletask_spec.rb +21 -21
  83. data/spec/ncoverreport_spec.rb +538 -523
  84. data/spec/ncoverreporttask_spec.rb +21 -21
  85. data/spec/ndepend_spec.rb +49 -0
  86. data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
  87. data/spec/nunittask_spec.rb +21 -21
  88. data/spec/nunittestrunner_spec.rb +6 -6
  89. data/spec/patches/docu_patch.rb +13 -0
  90. data/spec/patches/system_patch.rb +18 -18
  91. data/spec/patches/tasklib_patch.rb +10 -10
  92. data/spec/plink_spec.rb +61 -0
  93. data/spec/plinktask_spec.rb +31 -0
  94. data/spec/renametask_spec.rb +21 -21
  95. data/spec/sftp_spec.rb +24 -24
  96. data/spec/sftptask_spec.rb +31 -31
  97. data/spec/sqlcmd_spec.rb +118 -120
  98. data/spec/sqlcmdtask_spec.rb +21 -21
  99. data/spec/ssh_spec.rb +36 -37
  100. data/spec/sshtask_spec.rb +29 -29
  101. data/spec/support/TestSolution/NDependProject.xml +315 -0
  102. data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
  103. data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
  104. data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
  105. data/spec/support/TestSolution/TestSolution.build +25 -0
  106. data/spec/support/assemblyinfotester.rb +40 -38
  107. data/spec/support/expandtemplatestestdata.rb +73 -73
  108. data/spec/support/msbuildtestdata.rb +28 -28
  109. data/spec/support/nanttestdata.rb +33 -0
  110. data/spec/support/ncoverconsoletestdata.rb +18 -0
  111. data/spec/support/ncoverreporttestdata.rb +24 -24
  112. data/spec/support/spec_helper.rb +2 -1
  113. data/spec/support/yamlconfig/msbuild.yml +3 -0
  114. data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
  115. data/spec/support/ziptestdata.rb +11 -6
  116. data/spec/xunit_spec.rb +63 -0
  117. data/spec/xunittask_spec.rb +19 -19
  118. data/spec/yamlconfig_spec.rb +38 -52
  119. data/spec/zip_spec.rb +56 -11
  120. data/spec/ziptask_spec.rb +22 -22
  121. metadata +53 -8
  122. data/lib/albacore/command.rb +0 -23
  123. data/lib/rake/commandtask.rb +0 -16
  124. data/spec/command_spec.rb +0 -23
@@ -3,244 +3,449 @@ require 'assemblyinfotester'
3
3
  require 'albacore/assemblyinfo'
4
4
 
5
5
  describe AssemblyInfo, "when generating an assembly info file" do
6
- before :all do
7
- @tester = AssemblyInfoTester.new
8
- asm = AssemblyInfo.new
9
- strio = StringIO.new
10
- asm.log_device = strio
11
-
12
- @tester.build_and_read_assemblyinfo_file asm
13
-
14
- @log_data = strio.string
15
- end
16
-
17
- it "should log the name of the output file" do
18
- @log_data.should include(@tester.assemblyinfo_file)
19
- end
6
+ before :all do
7
+ @tester = AssemblyInfoTester.new
8
+ asm = AssemblyInfo.new
9
+ strio = StringIO.new
10
+ asm.log_device = strio
11
+
12
+ @tester.build_and_read_assemblyinfo_file asm
13
+
14
+ @log_data = strio.string
15
+ end
16
+
17
+ it "should log the name of the output file" do
18
+ @log_data.should include(@tester.assemblyinfo_file)
19
+ end
20
20
  end
21
21
 
22
22
  describe AssemblyInfo, "when generating an assembly info file in verbose mode" do
23
- before :all do
24
- @tester = AssemblyInfoTester.new
25
- asm = AssemblyInfo.new
26
- strio = StringIO.new
27
- asm.log_device = strio
28
- asm.log_level = :verbose
29
-
30
- asm.version = @tester.version
31
-
32
- @tester.build_and_read_assemblyinfo_file asm
33
- @log_data = strio.string
34
- end
35
-
36
- it "should log the name of the output file" do
37
- @log_data.should include(@tester.assemblyinfo_file)
38
- end
39
-
40
- it "should log the supplied attribute information" do
41
- @log_data.should include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
42
- end
23
+ before :all do
24
+ @tester = AssemblyInfoTester.new
25
+ asm = AssemblyInfo.new
26
+ strio = StringIO.new
27
+ asm.log_device = strio
28
+ asm.log_level = :verbose
29
+
30
+ asm.version = @tester.version
31
+
32
+ @tester.build_and_read_assemblyinfo_file asm
33
+ @log_data = strio.string
34
+ end
35
+
36
+ it "should log the name of the output file" do
37
+ @log_data.should include(@tester.assemblyinfo_file)
38
+ end
39
+
40
+ it "should log the supplied attribute information" do
41
+ @log_data.should include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
42
+ end
43
43
  end
44
44
 
45
45
  describe AssemblyInfo, "when generating an assembly info file without an output file specified" do
46
- before :all do
47
- @tester = AssemblyInfoTester.new
48
- asm = AssemblyInfo.new
49
- strio = StringIO.new
50
- asm.log_device = strio
51
-
52
- asm.write
53
-
54
- @log_data = strio.string
55
- end
56
-
57
- it "should log an error message saying the output file is required" do
58
- @log_data.should include("output_file cannot be nil")
59
- end
60
- end
61
-
62
- describe AssemblyInfo, "when providing custom namespaces" do
63
- before :all do
64
- @tester = AssemblyInfoTester.new
65
- asm = AssemblyInfo.new
66
-
67
- asm.namespaces ['My.Name.Space', 'Another.Namespace.GoesHere']
68
-
69
- @filedata = @tester.build_and_read_assemblyinfo_file asm
70
- end
71
-
72
- it "should write the namespaces into the using statements" do
73
- @filedata.should include("using My.Name.Space;")
74
- @filedata.should include("using Another.Namespace.GoesHere;")
75
- end
76
- end
77
-
78
- describe AssemblyInfo, "when providing custom attributes" do
79
- before :all do
80
- @tester = AssemblyInfoTester.new
81
- asm = AssemblyInfo.new
82
-
83
- asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
84
-
85
- @filedata = @tester.build_and_read_assemblyinfo_file asm
86
- end
87
-
88
- it "should write the custom attributes to the assembly info file" do
89
- @filedata.should include("[assembly: CustomAttribute(\"custom attribute data\")]")
90
- @filedata.should include("[assembly: AnotherAttribute(\"more data here\")]")
91
- end
46
+ before :all do
47
+ @tester = AssemblyInfoTester.new
48
+ asm = AssemblyInfo.new
49
+ strio = StringIO.new
50
+ asm.log_device = strio
51
+
52
+ asm.write
53
+
54
+ @log_data = strio.string
55
+ end
56
+
57
+ it "should log an error message saying the output file is required" do
58
+ @log_data.should include("output_file cannot be nil")
59
+ end
60
+ end
61
+
62
+ describe AssemblyInfo, "when providing a custom namespace without specifiying the language" do
63
+ before :all do
64
+ @tester = AssemblyInfoTester.new
65
+ asm = AssemblyInfo.new
66
+
67
+ asm.namespaces 'My.Name.Space'
68
+
69
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
70
+ end
71
+
72
+ it "should default to c# for the generated assemby info" do
73
+ @filedata.should include("using My.Name.Space;")
74
+ end
75
+ end
76
+
77
+ describe AssemblyInfo, "when providing custom namespaces and specifying C#" do
78
+ before :all do
79
+ @tester = AssemblyInfoTester.new
80
+ @tester.lang_engine = CSharpEngine.new
81
+ asm = AssemblyInfo.new
82
+ asm.lang_engine = CSharpEngine.new
83
+
84
+ asm.namespaces 'My.Name.Space', 'Another.Namespace.GoesHere'
85
+
86
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
87
+ end
88
+
89
+ it "should write the namespaces into the using statements" do
90
+ @filedata.should include("using My.Name.Space;")
91
+ @filedata.should include("using Another.Namespace.GoesHere;")
92
+ end
93
+ end
94
+
95
+ describe AssemblyInfo, "when providing custom namespaces and specifying VB.NET" do
96
+ before :all do
97
+ @tester = AssemblyInfoTester.new
98
+ @tester.lang_engine = VbNetEngine.new
99
+ asm = AssemblyInfo.new
100
+ asm.lang_engine = VbNetEngine.new
101
+
102
+ asm.namespaces 'My.Name.Space', 'Another.Namespace.GoesHere'
103
+
104
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
105
+ end
106
+
107
+ it "should write the namespaces into the imports statements" do
108
+ @filedata.should include("Imports My.Name.Space")
109
+ @filedata.should include("Imports Another.Namespace.GoesHere")
110
+ end
111
+ end
112
+
113
+ describe AssemblyInfo, "when providing custom attributes without specifying a language" do
114
+ before :all do
115
+ @tester = AssemblyInfoTester.new
116
+ asm = AssemblyInfo.new
117
+
118
+ asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
119
+
120
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
121
+ end
122
+
123
+ it "should write the custom attributes to the assembly info file" do
124
+ @filedata.should include("[assembly: CustomAttribute(\"custom attribute data\")]")
125
+ @filedata.should include("[assembly: AnotherAttribute(\"more data here\")]")
126
+ end
127
+ end
128
+
129
+ describe AssemblyInfo, "when providing custom attributes and specifying C#" do
130
+ before :all do
131
+ @tester = AssemblyInfoTester.new
132
+ @tester.lang_engine = CSharpEngine.new
133
+ asm = AssemblyInfo.new
134
+ asm.lang_engine = CSharpEngine.new
135
+
136
+ asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
137
+
138
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
139
+ end
140
+
141
+ it "should write the custom attributes to the assembly info file" do
142
+ @filedata.should include("[assembly: CustomAttribute(\"custom attribute data\")]")
143
+ @filedata.should include("[assembly: AnotherAttribute(\"more data here\")]")
144
+ end
145
+ end
146
+
147
+ describe AssemblyInfo, "when providing custom attributes and specifying VB.NET" do
148
+ before :all do
149
+ @tester = AssemblyInfoTester.new
150
+ @tester.lang_engine = VbNetEngine.new
151
+ asm = AssemblyInfo.new
152
+ asm.lang_engine = VbNetEngine.new
153
+
154
+ asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
155
+
156
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
157
+ end
158
+
159
+ it "should write the custom attributes to the assembly info file" do
160
+ @filedata.should include("<assembly: CustomAttribute(\"custom attribute data\")>")
161
+ @filedata.should include("<assembly: AnotherAttribute(\"more data here\")>")
162
+ end
92
163
  end
93
164
 
94
165
  describe AssemblyInfo, "when specifying a custom attribute with no data" do
95
- before :all do
96
- @tester = AssemblyInfoTester.new
97
- asm = AssemblyInfo.new
98
-
99
- asm.custom_attributes :NoArgsAttribute => nil
166
+ before :all do
167
+ @tester = AssemblyInfoTester.new
168
+ asm = AssemblyInfo.new
169
+
170
+ asm.custom_attributes :NoArgsAttribute => nil
100
171
 
101
- @filedata = @tester.build_and_read_assemblyinfo_file asm
102
- end
103
-
104
- it "should write the attribute with an empty argument list" do
105
- @filedata.should include("[assembly: NoArgsAttribute()]")
106
- end
172
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
173
+ end
174
+
175
+ it "should write the attribute with an empty argument list" do
176
+ @filedata.should include("[assembly: NoArgsAttribute()]")
177
+ end
107
178
  end
108
179
 
109
180
  describe AssemblyInfo, "when specifying an attribute with non-string data" do
110
- before :all do
111
- @tester = AssemblyInfoTester.new
112
- asm = AssemblyInfo.new
113
-
114
- asm.custom_attributes :NonStringAttribute => true
115
-
116
- @filedata = @tester.build_and_read_assemblyinfo_file asm
117
- end
118
-
119
- it "should write the attribute data without quotes" do
120
- @filedata.should include("[assembly: NonStringAttribute(true)]")
121
- end
122
- end
123
-
124
- describe AssemblyInfo, "when generating an assembly info file with the built in attributes" do
125
- before :all do
126
- @tester = AssemblyInfoTester.new
127
- asm = AssemblyInfo.new
128
-
129
- asm.company_name = @tester.company_name
130
- asm.product_name = @tester.product_name
131
- asm.version = @tester.version
132
- asm.title = @tester.title
133
- asm.description = @tester.description
134
- asm.copyright = @tester.copyright
135
- asm.com_visible = @tester.com_visible
136
- asm.com_guid = @tester.com_guid
137
- asm.file_version = @tester.file_version
138
- asm.trademark = @tester.trademark
139
-
140
- @filedata = @tester.build_and_read_assemblyinfo_file asm
141
- end
142
-
143
- it "should use the system.reflection namespace" do
144
- @filedata.should include("using System.Reflection;")
145
- end
146
-
147
- it "should use the system.runtime.interopservices namespace" do
148
- @filedata.should include("using System.Runtime.InteropServices;")
149
- end
150
-
151
- it "should contain the specified version information" do
152
- @filedata.should include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
153
- end
154
-
155
- it "should contain the assembly title" do
156
- @filedata.should include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
157
- end
158
-
159
- it "should contain the assembly description" do
160
- @filedata.should include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
161
- end
162
-
163
- it "should contain the copyright information" do
164
- @filedata.should include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
165
- end
166
-
167
- it "should contain the com visible information" do
168
- @filedata.should include("[assembly: ComVisible(#{@tester.com_visible})]")
169
- @filedata.should include("[assembly: Guid(\"#{@tester.com_guid}\")]")
170
- end
171
-
172
- it "should contain the company name information" do
173
- @filedata.should include("[assembly: AssemblyCompany(\"#{@tester.company_name}\")]")
174
- end
175
-
176
- it "should contain the product information" do
177
- @filedata.should include("[assembly: AssemblyProduct(\"#{@tester.product_name}\")]")
178
- end
179
-
180
- it "should contain the file version information" do
181
- @filedata.should include("[assembly: AssemblyFileVersion(\"#{@tester.file_version}\")]")
182
- end
183
-
184
- it "should contain the trademark information" do
185
- @filedata.should include("[assembly: AssemblyTrademark(\"#{@tester.trademark}\")]")
186
- end
181
+ before :all do
182
+ @tester = AssemblyInfoTester.new
183
+ asm = AssemblyInfo.new
184
+
185
+ asm.custom_attributes :NonStringAttribute => true
186
+
187
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
188
+ end
189
+
190
+ it "should write the attribute data without quotes" do
191
+ @filedata.should include("[assembly: NonStringAttribute(true)]")
192
+ end
193
+ end
194
+
195
+ describe AssemblyInfo, "when generating an assembly info file with the built in attributes and no language specified" do
196
+ before :all do
197
+ @tester = AssemblyInfoTester.new
198
+ asm = AssemblyInfo.new
199
+
200
+ asm.company_name = @tester.company_name
201
+ asm.product_name = @tester.product_name
202
+ asm.version = @tester.version
203
+ asm.title = @tester.title
204
+ asm.description = @tester.description
205
+ asm.copyright = @tester.copyright
206
+ asm.com_visible = @tester.com_visible
207
+ asm.com_guid = @tester.com_guid
208
+ asm.file_version = @tester.file_version
209
+ asm.trademark = @tester.trademark
210
+
211
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
212
+ end
213
+
214
+ it "should use the system.reflection namespace" do
215
+ @filedata.should include("using System.Reflection;")
216
+ end
217
+
218
+ it "should use the system.runtime.interopservices namespace" do
219
+ @filedata.should include("using System.Runtime.InteropServices;")
220
+ end
221
+
222
+ it "should contain the specified version information" do
223
+ @filedata.should include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
224
+ end
225
+
226
+ it "should contain the assembly title" do
227
+ @filedata.should include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
228
+ end
229
+
230
+ it "should contain the assembly description" do
231
+ @filedata.should include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
232
+ end
233
+
234
+ it "should contain the copyright information" do
235
+ @filedata.should include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
236
+ end
237
+
238
+ it "should contain the com visible information" do
239
+ @filedata.should include("[assembly: ComVisible(#{@tester.com_visible})]")
240
+ @filedata.should include("[assembly: Guid(\"#{@tester.com_guid}\")]")
241
+ end
242
+
243
+ it "should contain the company name information" do
244
+ @filedata.should include("[assembly: AssemblyCompany(\"#{@tester.company_name}\")]")
245
+ end
246
+
247
+ it "should contain the product information" do
248
+ @filedata.should include("[assembly: AssemblyProduct(\"#{@tester.product_name}\")]")
249
+ end
250
+
251
+ it "should contain the file version information" do
252
+ @filedata.should include("[assembly: AssemblyFileVersion(\"#{@tester.file_version}\")]")
253
+ end
254
+
255
+ it "should contain the trademark information" do
256
+ @filedata.should include("[assembly: AssemblyTrademark(\"#{@tester.trademark}\")]")
257
+ end
258
+ end
259
+
260
+ describe AssemblyInfo, "when generating an assembly info file with the built in attributes and C# specified" do
261
+ before :all do
262
+ @tester = AssemblyInfoTester.new
263
+ @tester.lang_engine = CSharpEngine.new
264
+ asm = AssemblyInfo.new
265
+ asm.lang_engine = CSharpEngine.new
266
+
267
+ asm.company_name = @tester.company_name
268
+ asm.product_name = @tester.product_name
269
+ asm.version = @tester.version
270
+ asm.title = @tester.title
271
+ asm.description = @tester.description
272
+ asm.copyright = @tester.copyright
273
+ asm.com_visible = @tester.com_visible
274
+ asm.com_guid = @tester.com_guid
275
+ asm.file_version = @tester.file_version
276
+ asm.trademark = @tester.trademark
277
+
278
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
279
+ end
280
+
281
+ it "should use the system.reflection namespace" do
282
+ @filedata.should include("using System.Reflection;")
283
+ end
284
+
285
+ it "should use the system.runtime.interopservices namespace" do
286
+ @filedata.should include("using System.Runtime.InteropServices;")
287
+ end
288
+
289
+ it "should contain the specified version information" do
290
+ @filedata.should include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
291
+ end
292
+
293
+ it "should contain the assembly title" do
294
+ @filedata.should include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
295
+ end
296
+
297
+ it "should contain the assembly description" do
298
+ @filedata.should include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
299
+ end
300
+
301
+ it "should contain the copyright information" do
302
+ @filedata.should include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
303
+ end
304
+
305
+ it "should contain the com visible information" do
306
+ @filedata.should include("[assembly: ComVisible(#{@tester.com_visible})]")
307
+ @filedata.should include("[assembly: Guid(\"#{@tester.com_guid}\")]")
308
+ end
309
+
310
+ it "should contain the company name information" do
311
+ @filedata.should include("[assembly: AssemblyCompany(\"#{@tester.company_name}\")]")
312
+ end
313
+
314
+ it "should contain the product information" do
315
+ @filedata.should include("[assembly: AssemblyProduct(\"#{@tester.product_name}\")]")
316
+ end
317
+
318
+ it "should contain the file version information" do
319
+ @filedata.should include("[assembly: AssemblyFileVersion(\"#{@tester.file_version}\")]")
320
+ end
321
+
322
+ it "should contain the trademark information" do
323
+ @filedata.should include("[assembly: AssemblyTrademark(\"#{@tester.trademark}\")]")
324
+ end
325
+ end
326
+
327
+ describe AssemblyInfo, "when generating an assembly info file with the built in attributes and VB.NET specified" do
328
+ before :all do
329
+ @tester = AssemblyInfoTester.new
330
+ @tester.lang_engine = VbNetEngine.new
331
+ asm = AssemblyInfo.new
332
+ asm.lang_engine = VbNetEngine.new
333
+
334
+ asm.company_name = @tester.company_name
335
+ asm.product_name = @tester.product_name
336
+ asm.version = @tester.version
337
+ asm.title = @tester.title
338
+ asm.description = @tester.description
339
+ asm.copyright = @tester.copyright
340
+ asm.com_visible = @tester.com_visible
341
+ asm.com_guid = @tester.com_guid
342
+ asm.file_version = @tester.file_version
343
+ asm.trademark = @tester.trademark
344
+
345
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
346
+ end
347
+
348
+ it "should use the system.reflection namespace" do
349
+ @filedata.should include("Imports System.Reflection")
350
+ end
351
+
352
+ it "should use the system.runtime.interopservices namespace" do
353
+ @filedata.should include("Imports System.Runtime.InteropServices")
354
+ end
355
+
356
+ it "should contain the specified version information" do
357
+ @filedata.should include("<assembly: AssemblyVersion(\"#{@tester.version}\")>")
358
+ end
359
+
360
+ it "should contain the assembly title" do
361
+ @filedata.should include("<assembly: AssemblyTitle(\"#{@tester.title}\")>")
362
+ end
363
+
364
+ it "should contain the assembly description" do
365
+ @filedata.should include("<assembly: AssemblyDescription(\"#{@tester.description}\")>")
366
+ end
367
+
368
+ it "should contain the copyright information" do
369
+ @filedata.should include("<assembly: AssemblyCopyright(\"#{@tester.copyright}\")>")
370
+ end
371
+
372
+ it "should contain the com visible information" do
373
+ @filedata.should include("<assembly: ComVisible(#{@tester.com_visible})>")
374
+ @filedata.should include("<assembly: Guid(\"#{@tester.com_guid}\")>")
375
+ end
376
+
377
+ it "should contain the company name information" do
378
+ @filedata.should include("<assembly: AssemblyCompany(\"#{@tester.company_name}\")>")
379
+ end
380
+
381
+ it "should contain the product information" do
382
+ @filedata.should include("<assembly: AssemblyProduct(\"#{@tester.product_name}\")>")
383
+ end
384
+
385
+ it "should contain the file version information" do
386
+ @filedata.should include("<assembly: AssemblyFileVersion(\"#{@tester.file_version}\")>")
387
+ end
388
+
389
+ it "should contain the trademark information" do
390
+ @filedata.should include("<assembly: AssemblyTrademark(\"#{@tester.trademark}\")>")
391
+ end
187
392
  end
188
393
 
189
394
  describe AssemblyInfo, "when generating an assembly info file with no attributes provided" do
190
- before :all do
191
- @tester = AssemblyInfoTester.new
192
- asm = AssemblyInfo.new
193
-
194
- @filedata = @tester.build_and_read_assemblyinfo_file asm
195
- end
196
-
197
- it "should not contain the specified version information" do
198
- @filedata.should_not include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
199
- end
200
-
201
- it "should not contain the assembly title" do
202
- @filedata.should_not include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
203
- end
204
-
205
- it "should not contain the assembly description" do
206
- @filedata.should_not include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
207
- end
208
-
209
- it "should not contain the copyright information" do
210
- @filedata.should_not include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
211
- end
212
-
213
- it "should not contain the com visible information" do
214
- @filedata.should_not include("[assembly: ComVisible(#{@tester.com_visible})]")
215
- @filedata.should_not include("[assembly: Guid(\"#{@tester.com_guid}\")]")
216
- end
217
-
218
- it "should not contain the company name information" do
219
- @filedata.should_not include("[assembly: AssemblyCompany(\"#{@tester.company_name}\")]")
220
- end
221
-
222
- it "should not contain the product information" do
223
- @filedata.should_not include("[assembly: AssemblyProduct(\"#{@tester.product_name}\")]")
224
- end
225
-
226
- it "should not contain the file version information" do
227
- @filedata.should_not include("[assembly: AssemblyFileVersion(\"#{@tester.file_version}\")]")
228
- end
229
-
230
- it "should not contain the trademark information" do
231
- @filedata.should_not include("[assembly: AssemblyTrademark(\"#{@tester.trademark}\")]")
232
- end
395
+ before :all do
396
+ @tester = AssemblyInfoTester.new
397
+ asm = AssemblyInfo.new
398
+
399
+ @filedata = @tester.build_and_read_assemblyinfo_file asm
400
+ end
401
+
402
+ it "should not contain the specified version information" do
403
+ @filedata.should_not include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
404
+ end
405
+
406
+ it "should not contain the assembly title" do
407
+ @filedata.should_not include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
408
+ end
409
+
410
+ it "should not contain the assembly description" do
411
+ @filedata.should_not include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
412
+ end
413
+
414
+ it "should not contain the copyright information" do
415
+ @filedata.should_not include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
416
+ end
417
+
418
+ it "should not contain the com visible information" do
419
+ @filedata.should_not include("[assembly: ComVisible(#{@tester.com_visible})]")
420
+ @filedata.should_not include("[assembly: Guid(\"#{@tester.com_guid}\")]")
421
+ end
422
+
423
+ it "should not contain the company name information" do
424
+ @filedata.should_not include("[assembly: AssemblyCompany(\"#{@tester.company_name}\")]")
425
+ end
426
+
427
+ it "should not contain the product information" do
428
+ @filedata.should_not include("[assembly: AssemblyProduct(\"#{@tester.product_name}\")]")
429
+ end
430
+
431
+ it "should not contain the file version information" do
432
+ @filedata.should_not include("[assembly: AssemblyFileVersion(\"#{@tester.file_version}\")]")
433
+ end
434
+
435
+ it "should not contain the trademark information" do
436
+ @filedata.should_not include("[assembly: AssemblyTrademark(\"#{@tester.trademark}\")]")
437
+ end
233
438
  end
234
439
 
235
440
  describe AssemblyInfo, "when configuring the assembly info generator with a yaml file" do
236
- before :all do
237
- tester = AssemblyInfoTester.new
238
- @asm = AssemblyInfo.new
239
- @asm.configure(tester.yaml_file)
240
- end
241
-
242
- it "should set the values for the provided attributes" do
243
- @asm.version.should == "0.0.1"
244
- @asm.company_name.should == "some company name"
245
- end
441
+ before :all do
442
+ tester = AssemblyInfoTester.new
443
+ @asm = AssemblyInfo.new
444
+ @asm.configure(tester.yaml_file)
445
+ end
446
+
447
+ it "should set the values for the provided attributes" do
448
+ @asm.version.should == "0.0.1"
449
+ @asm.company_name.should == "some company name"
450
+ end
246
451
  end