Permalink
Browse files

Merge branch 'hotfix-0.6.2'

  • Loading branch information...
2 parents 4086e1f + 318e2f3 commit e5364ed4dfd8034f6a9725c10117dcca42a57724 @danielmarbach danielmarbach committed Jan 7, 2014
Showing with 355 additions and 33,797 deletions.
  1. +5 −4 .gitignore
  2. +7 −0 CONTRIBUTING.md
  3. +4 −0 Gemfile
  4. +23 −0 Gemfile.lock
  5. +57 −0 HOW_TO_BUILD.md
  6. +1 −1 README.markdown → README.md
  7. +1 −1 Source/Examples/Example.Failing/FailingContext.cs
  8. +0 −1 Source/Machine.Specifications.Should.Specs/Machine.Specifications.Should.Specs.csproj
  9. +0 −1 Source/Machine.Specifications.Should/Machine.Specifications.Should.csproj
  10. +81 −81 Source/{Machine.Specifications.Should.Specs → Machine.Specifications.Specs}/CatchSpecs.cs
  11. +1 −0 Source/Machine.Specifications.Specs/Machine.Specifications.Specs.csproj
  12. 0 Source/{Machine.Specifications.Should → Machine.Specifications}/Catch.cs
  13. +1 −0 Source/Machine.Specifications/Framework.cs
  14. +1 −0 Source/Machine.Specifications/Machine.Specifications.csproj
  15. +2 −1 Source/Runners/Machine.Specifications.ConsoleRunner/Machine.Specifications.ConsoleRunner.csproj
  16. +45 −0 Source/Runners/Machine.Specifications.ConsoleRunner/Machine.Specifications.ConsoleRunner.targets
  17. +4 −9 Source/Runners/Machine.Specifications.ReSharperRunner.6.1/Explorers/MSpecTestMetadataExplorer.cs
  18. +4 −9 Source/Runners/Machine.Specifications.ReSharperRunner.8.0/Explorers/MSpecTestMetadataExplorer.cs
  19. +0 −5 ...fications.ReSharperRunner.Debug.VS2010/Machine.Specifications.ReSharperRunner.Debug.VS2010.csproj
  20. +9 −6 Source/Runners/Machine.Specifications.TDNetRunner/Machine.Specifications.TDNetRunner.csproj
  21. +1 −1 ...ations.TDNetRunner/{Machine.Specifications.dll.tdnet.template → Machine.Specifications.dll.tdnet}
  22. +0 −57 Tools/Gallio/ASL - Apache Software Foundation License.txt
  23. +0 −14 Tools/Gallio/Gallio License.txt
  24. BIN Tools/Gallio/bin/Gallio.Echo.exe
  25. +0 −29 Tools/Gallio/bin/Gallio.Echo.exe.config
  26. +0 −18 Tools/Gallio/bin/Gallio.Echo.plugin
  27. BIN Tools/Gallio/bin/Gallio.Reports.dll
  28. +0 −298 Tools/Gallio/bin/Gallio.Reports.plugin
  29. BIN Tools/Gallio/bin/Gallio.UI.dll
  30. +0 −127 Tools/Gallio/bin/Gallio.UI.plugin
  31. BIN Tools/Gallio/bin/Gallio.dll
  32. +0 −676 Tools/Gallio/bin/Gallio.plugin
  33. BIN Tools/Gallio/bin/NUnit/254-10/Gallio.NUnitAdapter254-10.dll
  34. +0 −84 Tools/Gallio/bin/NUnit/254-10/Gallio.NUnitAdapter254-10.plugin
  35. +0 −12 Tools/Gallio/bin/NUnit/254-10/Readme.txt
  36. BIN Tools/Gallio/bin/NUnit/254-10/Resources/NUnit.ico
  37. +0 −1 Tools/Gallio/bin/NUnit/254-10/addins/NUnit Addins Readme.txt
  38. +0 −15 Tools/Gallio/bin/NUnit/254-10/license.txt
  39. BIN Tools/Gallio/bin/NUnit/254-10/nunit.core.dll
  40. BIN Tools/Gallio/bin/NUnit/254-10/nunit.core.interfaces.dll
  41. BIN Tools/Gallio/bin/NUnit/254-10/nunit.framework.dll
  42. +0 −6 Tools/Gallio/bin/NUnit/254-10/nunit.framework.dll.tdnet
  43. BIN Tools/Gallio/bin/NUnit/254-10/nunit.util.dll
  44. BIN Tools/Gallio/bin/NUnit/Latest/Gallio.NUnitAdapterLatest.dll
  45. +0 −84 Tools/Gallio/bin/NUnit/Latest/Gallio.NUnitAdapterLatest.plugin
  46. +0 −12 Tools/Gallio/bin/NUnit/Latest/Readme.txt
  47. BIN Tools/Gallio/bin/NUnit/Latest/Resources/NUnit.ico
  48. +0 −1 Tools/Gallio/bin/NUnit/Latest/addins/NUnit Addins Readme.txt
  49. +0 −15 Tools/Gallio/bin/NUnit/Latest/license.txt
  50. BIN Tools/Gallio/bin/NUnit/Latest/nunit.core.dll
  51. BIN Tools/Gallio/bin/NUnit/Latest/nunit.core.interfaces.dll
  52. BIN Tools/Gallio/bin/NUnit/Latest/nunit.framework.dll
  53. +0 −6 Tools/Gallio/bin/NUnit/Latest/nunit.framework.dll.tdnet
  54. +0 −10,960 Tools/Gallio/bin/NUnit/Latest/nunit.framework.xml
  55. BIN Tools/Gallio/bin/NUnit/Latest/nunit.util.dll
  56. +0 −42 Tools/Gallio/bin/Resources/vm/Gallio-Report.txt-common.vm
  57. +0 −5 Tools/Gallio/bin/Resources/vm/Gallio-Report.txt.vm
  58. +0 −30 Tools/Rake/assemblyinfo.rb
  59. BIN Tools/Rake/bin/msvcrt-ruby18.dll
  60. +0 −31 Tools/Rake/bin/rake
  61. BIN Tools/Rake/bin/ruby.exe
  62. +0 −23 Tools/Rake/filelist.rb
  63. +0 −1,708 Tools/Rake/lib/ruby/1.8/date.rb
  64. +0 −1,088 Tools/Rake/lib/ruby/1.8/date/format.rb
  65. +0 −335 Tools/Rake/lib/ruby/1.8/delegate.rb
  66. +0 −826 Tools/Rake/lib/ruby/1.8/erb.rb
  67. +0 −1,591 Tools/Rake/lib/ruby/1.8/fileutils.rb
  68. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/Win32API.so
  69. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/bigdecimal.so
  70. +0 −92 Tools/Rake/lib/ruby/1.8/i386-mswin32/config.h
  71. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/curses.so
  72. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/dbm.so
  73. +0 −262 Tools/Rake/lib/ruby/1.8/i386-mswin32/defines.h
  74. +0 −32 Tools/Rake/lib/ruby/1.8/i386-mswin32/digest.h
  75. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/digest.so
  76. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/digest/bubblebabble.so
  77. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/digest/md5.so
  78. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/digest/rmd160.so
  79. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/digest/sha1.so
  80. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/digest/sha2.so
  81. +0 −313 Tools/Rake/lib/ruby/1.8/i386-mswin32/dl.h
  82. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/dl.so
  83. +0 −16 Tools/Rake/lib/ruby/1.8/i386-mswin32/dlconfig.h
  84. +0 −40 Tools/Rake/lib/ruby/1.8/i386-mswin32/dln.h
  85. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/enumerator.so
  86. +0 −60 Tools/Rake/lib/ruby/1.8/i386-mswin32/env.h
  87. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/etc.so
  88. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/fcntl.so
  89. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/gdbm.so
  90. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/iconv.so
  91. +0 −508 Tools/Rake/lib/ruby/1.8/i386-mswin32/intern.h
  92. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/io/wait.so
  93. +0 −142 Tools/Rake/lib/ruby/1.8/i386-mswin32/missing.h
  94. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/nkf.so
  95. +0 −474 Tools/Rake/lib/ruby/1.8/i386-mswin32/node.h
  96. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/openssl.so
  97. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/racc/cparse.so
  98. +0 −154 Tools/Rake/lib/ruby/1.8/i386-mswin32/rbconfig.rb
  99. +0 −42 Tools/Rake/lib/ruby/1.8/i386-mswin32/re.h
  100. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/readline.so
  101. +0 −221 Tools/Rake/lib/ruby/1.8/i386-mswin32/regex.h
  102. +0 −759 Tools/Rake/lib/ruby/1.8/i386-mswin32/ruby.h
  103. +0 −88 Tools/Rake/lib/ruby/1.8/i386-mswin32/rubyio.h
  104. +0 −105 Tools/Rake/lib/ruby/1.8/i386-mswin32/rubysig.h
  105. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/sdbm.so
  106. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/socket.so
  107. +0 −72 Tools/Rake/lib/ruby/1.8/i386-mswin32/st.h
  108. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/stringio.so
  109. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/strscan.so
  110. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/syck.so
  111. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/tcltklib.so
  112. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/thread.so
  113. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/tkutil.so
  114. +0 −67 Tools/Rake/lib/ruby/1.8/i386-mswin32/util.h
  115. +0 −19 Tools/Rake/lib/ruby/1.8/i386-mswin32/version.h
  116. +0 −559 Tools/Rake/lib/ruby/1.8/i386-mswin32/win32/win32.h
  117. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/win32ole.so
  118. BIN Tools/Rake/lib/ruby/1.8/i386-mswin32/zlib.so
  119. +0 −352 Tools/Rake/lib/ruby/1.8/monitor.rb
  120. +0 −1,788 Tools/Rake/lib/ruby/1.8/optparse.rb
  121. +0 −146 Tools/Rake/lib/ruby/1.8/ostruct.rb
  122. +0 −530 Tools/Rake/lib/ruby/1.8/rational.rb
  123. +0 −360 Tools/Rake/lib/ruby/1.8/singleton.rb
  124. +0 −193 Tools/Rake/lib/ruby/1.8/tempfile.rb
  125. +0 −45 Tools/Rake/lib/ruby/1.8/tmpdir.rb
  126. +0 −831 Tools/Rake/lib/ruby/1.8/win32/registry.rb
  127. +0 −436 Tools/Rake/lib/ruby/1.8/yaml.rb
  128. +0 −247 Tools/Rake/lib/ruby/1.8/yaml/baseemitter.rb
  129. +0 −216 Tools/Rake/lib/ruby/1.8/yaml/basenode.rb
  130. +0 −45 Tools/Rake/lib/ruby/1.8/yaml/constants.rb
  131. +0 −111 Tools/Rake/lib/ruby/1.8/yaml/dbm.rb
  132. +0 −33 Tools/Rake/lib/ruby/1.8/yaml/encoding.rb
  133. +0 −34 Tools/Rake/lib/ruby/1.8/yaml/error.rb
  134. +0 −14 Tools/Rake/lib/ruby/1.8/yaml/loader.rb
  135. +0 −408 Tools/Rake/lib/ruby/1.8/yaml/rubytypes.rb
  136. +0 −29 Tools/Rake/lib/ruby/1.8/yaml/store.rb
  137. +0 −40 Tools/Rake/lib/ruby/1.8/yaml/stream.rb
  138. +0 −83 Tools/Rake/lib/ruby/1.8/yaml/stringio.rb
  139. +0 −19 Tools/Rake/lib/ruby/1.8/yaml/syck.rb
  140. +0 −91 Tools/Rake/lib/ruby/1.8/yaml/tag.rb
  141. +0 −194 Tools/Rake/lib/ruby/1.8/yaml/types.rb
  142. +0 −54 Tools/Rake/lib/ruby/1.8/yaml/yamlnode.rb
  143. +0 −52 Tools/Rake/lib/ruby/1.8/yaml/ypath.rb
  144. +0 −12 Tools/Rake/lib/ruby/site_ruby/1.8/configatron.rb
  145. +0 −59 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/configatron.rb
  146. +0 −25 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/core_ext/class.rb
  147. +0 −8 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/core_ext/kernel.rb
  148. +0 −13 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/core_ext/object.rb
  149. +0 −90 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/core_ext/string.rb
  150. +0 −13 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/errors.rb
  151. +0 −104 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/proc.rb
  152. +0 −53 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/rails.rb
  153. +0 −310 Tools/Rake/lib/ruby/site_ruby/1.8/configatron/store.rb
  154. +0 −2,506 Tools/Rake/lib/ruby/site_ruby/1.8/rake.rb
  155. +0 −108 Tools/Rake/lib/ruby/site_ruby/1.8/rake/alt_system.rb
  156. +0 −8 Tools/Rake/lib/ruby/site_ruby/1.8/rake/classic_namespace.rb
  157. +0 −33 Tools/Rake/lib/ruby/site_ruby/1.8/rake/clean.rb
  158. +0 −24 Tools/Rake/lib/ruby/site_ruby/1.8/rake/contrib/compositepublisher.rb
  159. +0 −153 Tools/Rake/lib/ruby/site_ruby/1.8/rake/contrib/ftptools.rb
  160. +0 −75 Tools/Rake/lib/ruby/site_ruby/1.8/rake/contrib/publisher.rb
  161. +0 −18 Tools/Rake/lib/ruby/site_ruby/1.8/rake/contrib/rubyforgepublisher.rb
  162. +0 −47 Tools/Rake/lib/ruby/site_ruby/1.8/rake/contrib/sshpublisher.rb
  163. +0 −209 Tools/Rake/lib/ruby/site_ruby/1.8/rake/contrib/sys.rb
  164. +0 −97 Tools/Rake/lib/ruby/site_ruby/1.8/rake/gempackagetask.rb
  165. +0 −42 Tools/Rake/lib/ruby/site_ruby/1.8/rake/loaders/makefile.rb
  166. +0 −184 Tools/Rake/lib/ruby/site_ruby/1.8/rake/packagetask.rb
  167. +0 −5 Tools/Rake/lib/ruby/site_ruby/1.8/rake/rake_test_loader.rb
  168. +0 −209 Tools/Rake/lib/ruby/site_ruby/1.8/rake/rdoctask.rb
  169. +0 −23 Tools/Rake/lib/ruby/site_ruby/1.8/rake/ruby182_test_unit_fix.rb
  170. +0 −23 Tools/Rake/lib/ruby/site_ruby/1.8/rake/runtest.rb
  171. +0 −23 Tools/Rake/lib/ruby/site_ruby/1.8/rake/tasklib.rb
  172. +0 −161 Tools/Rake/lib/ruby/site_ruby/1.8/rake/testtask.rb
  173. +0 −55 Tools/Rake/lib/ruby/site_ruby/1.8/rake/win32.rb
  174. +0 −10 Tools/Rake/lib/ruby/site_ruby/1.8/rubygems.rb
  175. +0 −10 Tools/Rake/lib/ruby/site_ruby/1.8/ubygems.rb
  176. +0 −7 Tools/Rake/lib/ruby/site_ruby/1.8/yamler.rb
  177. +0 −67 Tools/Rake/lib/ruby/site_ruby/1.8/yamler/template.rb
  178. +0 −35 Tools/Rake/lib/ruby/site_ruby/1.8/yamler/yamler.rb
  179. +0 −43 Tools/Rake/msbuild.rb
  180. +0 −38 Tools/Rake/nunit.rb
  181. +0 −58 Tools/Rake/sevenzip.rb
  182. +0 −29 Tools/Rake/string.rb
  183. +0 −16 Tools/Rake/task.rb
  184. +0 −52 Tools/Rake/teamcity_messages.rb
  185. +1 −1 build.cmd
  186. +101 −145 rakefile.rb
  187. +6 −6 ripple.config
View
@@ -12,12 +12,13 @@ NDependOut
*.ncrunchproject
/.nuget/nuget.exe
-/Build
-/Distribution
-/Specs
+/Build/*
+/Distribution/*
+/Specs/*.*
/packages
install.ps1
-mspec.nuspec
+Misc/machine.specifications.nuspec
Source/packages/*
logs/*
+.bundle/*
View
@@ -0,0 +1,7 @@
+# How to Contribute
+
+First of all, thank you for wanting to contribute to Machine.Specifications! We really appreciate all the awesome support we get from our community. We want to keep it as easy as possible for you to contribute changes that make Machine.Specifications better for you. There are a few guidelines that we need contributors to follow so that we can all work together happily.
+
+## Preparation
+
+Before starting work on a new bug, feature, etc. ensure that an [issue](https://github.com/machine/machine.specifications/issues) has been raised. Indicate your intention to work on the issue by writing a comment against it. This will prevent duplication of effort. If the issue is a new feature, it's usually best to propose a design in the issue comments.
View
@@ -0,0 +1,4 @@
+source 'http://rubygems.org'
+gem 'rake'
+gem 'albacore', '~> 1.0.rc'
+gem 'configatron'
View
@@ -0,0 +1,23 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ albacore (1.0.0.rc.2)
+ nokogiri (~> 1.5)
+ rake
+ rubyzip (~> 1.0)
+ configatron (2.13.0)
+ yamler (>= 0.1.0)
+ mini_portile (0.5.2)
+ nokogiri (1.6.1-x86-mingw32)
+ mini_portile (~> 0.5.0)
+ rake (10.1.1)
+ rubyzip (1.1.0)
+ yamler (0.1.0)
+
+PLATFORMS
+ x86-mingw32
+
+DEPENDENCIES
+ albacore (~> 1.0.rc)
+ configatron
+ rake
View
@@ -0,0 +1,57 @@
+# How to build
+
+These instructions are *only* for building with Rake, which includes compilation, test execution and packaging. This is the simplest way to build.
+
+You can also build the solution using Visual Studio 2012 or later.
+
+*Don't be put off by the prerequisites!* It only takes a few minutes to set them up and only needs to be done once. If you haven't used [Rake](http://rake.rubyforge.org/ "RAKE -- Ruby Make") before then you're in for a real treat!
+
+At the time of writing the build is only confirmed to work on Windows using the Microsoft .NET framework.
+
+## Prerequisites
+
+1. Ensure you have .NET framework 3.5 and 4.0/4.5 installed.
+
+1. Install Ruby 2.0.0 or later.
+
+ For Windows we recommend using [RubyInstaller](http://rubyinstaller.org/) and selecting 'Add Ruby executables to your PATH' when prompted. For alternatives see the [Ruby download page](http://www.ruby-lang.org/en/downloads/). Be sure to use the 32 bit version.
+
+1. Install Ruby DevKit for 2.0.0 or later.
+
+ For Windows we recommend using [RubyInstaller](http://rubyinstaller.org/), follow the instructions for [DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit) . For alternatives see the [Ruby download page](http://www.ruby-lang.org/en/downloads/). Be sure to use the 32 bit version.
+
+1. Using a command prompt, install bundler:
+
+ `gem install bundler`
+
+1. Install/update necessary build tools, navigate to your clone root folder and execute:
+
+ `bundle install`
+
+## Building
+
+Using a command prompt, navigate to your clone root folder and execute:
+
+`rake`
+
+or use the provided build batch files.
+
+This executes the default build tasks. After the build has completed, the build artifacts will be located in `Build`.
+
+## Extras
+
+* View the full list of build tasks:
+
+ `rake -T`
+
+* Run a specific task:
+
+ `rake spec`
+
+* Run multiple tasks:
+
+ `rake spec pack`
+
+* View the full list of rake options:
+
+ `rake -h`
@@ -234,7 +234,7 @@ The MSpec HTML reports can show additional [Selenium](http://seleniumhq.org/)-sp
# ReSharper Integration
-MSpec provides a batch file to integrate with the ReSharper test runner, custom naming rules, and code annotations. MSpec currently supports ReSharper 6.1, 7.0, and 7.1.
+MSpec provides a batch file to integrate with the ReSharper test runner, custom naming rules, and code annotations. MSpec currently supports ReSharper 6.1, 7.0, 7.1, 8.0 and 8.1.
### Code Annotations
@@ -19,7 +19,7 @@ public class context_with_multiple_establish_clauses
It should = () => { };
}
- [DelegateUsage(DelegateUsage.Setup)]
+ [SetupDelegate]
public delegate void Given();
[Tags("example")]
@@ -46,7 +46,6 @@
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AssertionSpecs.cs" />
- <Compile Include="CatchSpecs.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShouldBeLikeSpecs.cs" />
<Compile Include="Utility\Internal\ErrorMessageSpecs.cs" />
@@ -40,7 +40,6 @@
</Compile>
<Compile Include="Annotations\ReSharperAttributes.cs" />
<Compile Include="AssertComparer.cs" />
- <Compile Include="Catch.cs" />
<Compile Include="ComparerStrategies\ComparableComparer.cs" />
<Compile Include="ComparerStrategies\ComparerFactory.cs" />
<Compile Include="ComparerStrategies\ComparisionResult.cs" />
@@ -1,82 +1,82 @@
-using System;
-
-namespace Machine.Specifications.Should.Specs
-{
- [Subject(typeof(Catch))]
- public class when_calling_Catch_Exception_with_an_Action
- {
- [Subject(typeof(Catch))]
- public class with_a_throwing_Action
- {
- static ArgumentException AnException;
- static Exception Result;
-
- Establish context = () => { AnException = new ArgumentException(); };
-
- Because of = () => { Result = Catch.Exception(() => { throw AnException; }); };
-
- It should_return_the_same_exception =
- () => Result.ShouldBeTheSameAs(AnException);
- }
-
- [Subject(typeof(Catch))]
- public class with_a_non_throwing_Action
- {
- static string ActionSideEffect;
- static Exception Result;
-
- Because of = () => { Result = Catch.Exception(() => { ActionSideEffect = "hi"; }); };
-
- It should_access_the_propety =
- () => ActionSideEffect.ShouldEqual("hi");
-
- It should_return_null =
- () => Result.ShouldBeNull();
- }
- }
-
- [Subject(typeof(Catch))]
- public class when_calling_Catch_Exception_with_a_Func
- {
- class Dummy
- {
- public static readonly ArgumentException AnException = new ArgumentException();
-
- public static string ThrowingProperty
- {
- get { throw AnException; }
- }
-
- public static string NonThrowingProperty
- {
- get { return "hi"; }
- }
- }
-
- [Subject(typeof(Catch))]
- public class with_a_throwing_Func
- {
- static Exception Result;
-
- Because of = () => { Result = Catch.Exception(() => Dummy.ThrowingProperty); };
-
- It should_return_the_same_exception =
- () => Result.ShouldBeTheSameAs(Dummy.AnException);
- }
-
- [Subject(typeof(Catch))]
- public class with_a_non_throwing_Func
- {
- static Exception Result;
- static string PropertyValue;
-
- Because of = () => { Result = Catch.Exception(() => PropertyValue = Dummy.NonThrowingProperty); };
-
- It should_access_the_propety =
- () => PropertyValue.ShouldEqual("hi");
-
- It should_return_null =
- () => Result.ShouldBeNull();
- }
- }
+using System;
+
+namespace Machine.Specifications.Specs
+{
+ [Subject(typeof(Catch))]
+ public class when_calling_Catch_Exception_with_an_Action
+ {
+ [Subject(typeof(Catch))]
+ public class with_a_throwing_Action
+ {
+ static ArgumentException AnException;
+ static Exception Result;
+
+ Establish context = () => { AnException = new ArgumentException(); };
+
+ Because of = () => { Result = Catch.Exception(() => { throw AnException; }); };
+
+ It should_return_the_same_exception =
+ () => Result.ShouldBeTheSameAs(AnException);
+ }
+
+ [Subject(typeof(Catch))]
+ public class with_a_non_throwing_Action
+ {
+ static string ActionSideEffect;
+ static Exception Result;
+
+ Because of = () => { Result = Catch.Exception(() => { ActionSideEffect = "hi"; }); };
+
+ It should_access_the_propety =
+ () => ActionSideEffect.ShouldEqual("hi");
+
+ It should_return_null =
+ () => Result.ShouldBeNull();
+ }
+ }
+
+ [Subject(typeof(Catch))]
+ public class when_calling_Catch_Exception_with_a_Func
+ {
+ class Dummy
+ {
+ public static readonly ArgumentException AnException = new ArgumentException();
+
+ public static string ThrowingProperty
+ {
+ get { throw AnException; }
+ }
+
+ public static string NonThrowingProperty
+ {
+ get { return "hi"; }
+ }
+ }
+
+ [Subject(typeof(Catch))]
+ public class with_a_throwing_Func
+ {
+ static Exception Result;
+
+ Because of = () => { Result = Catch.Exception(() => Dummy.ThrowingProperty); };
+
+ It should_return_the_same_exception =
+ () => Result.ShouldBeTheSameAs(Dummy.AnException);
+ }
+
+ [Subject(typeof(Catch))]
+ public class with_a_non_throwing_Func
+ {
+ static Exception Result;
+ static string PropertyValue;
+
+ Because of = () => { Result = Catch.Exception(() => PropertyValue = Dummy.NonThrowingProperty); };
+
+ It should_access_the_propety =
+ () => PropertyValue.ShouldEqual("hi");
+
+ It should_return_null =
+ () => Result.ShouldBeNull();
+ }
+ }
}
@@ -65,6 +65,7 @@
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
+ <Compile Include="CatchSpecs.cs" />
<Compile Include="ExceptionResultSpecs.cs" />
<Compile Include="Explorers\AssemblyExplorerSpecs.cs" />
<Compile Include="Factories\ContextFactorySpecs.cs" />
@@ -8,6 +8,7 @@ namespace Machine.Specifications
[AssertDelegate]
public delegate void It();
+
[BehaviorDelegate]
public delegate void Behaves_like<TBehavior>();
@@ -71,6 +71,7 @@
</Compile>
<Compile Include="Annotations\ReSharperAttributes.cs" />
<Compile Include="BehaviorsAttribute.cs" />
+ <Compile Include="Catch.cs" />
<Compile Include="DelegateUsageAttribute.cs" />
<Compile Include="Factories\BehaviorFactory.cs" />
<Compile Include="Factories\ITagExtractor.cs" />
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="4.0" DefaultTargets="Default;Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -125,6 +125,7 @@
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project=".\Machine.Specifications.ConsoleRunner.targets" />
<Import Project="$(SolutionDir)\Tools\Ripple\RippleRestoreTask.targets" />
<Import Project="$(SolutionDir)\Tools\GitFlowVersion\build\GitFlowVersionTask.targets" />
<PropertyGroup>
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Target Name="Default">
+ <ItemGroup>
+ <ConsoleRunners Include="Item1">
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <PlatformTarget>x86</PlatformTarget>
+ <AssemblyName>mspec-x86</AssemblyName>
+ </ConsoleRunners>
+ <ConsoleRunners Include="Item2">
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <PlatformTarget>x86</PlatformTarget>
+ <AssemblyName>mspec-x86-clr4</AssemblyName>
+ </ConsoleRunners>
+ <ConsoleRunners Include="Item3">
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <AssemblyName>mspec-clr4</AssemblyName>
+ </ConsoleRunners>
+ </ItemGroup>
+ <Copy
+ SourceFiles="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunner.csproj"
+ DestinationFiles="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj"/>
+
+ <XmlPoke XmlInputPath="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj"
+ Query="/ns:Project/@DefaultTargets"
+ Value="Build" Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"/>
+
+ <XmlPoke XmlInputPath="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj"
+ Query="//ns:AssemblyName"
+ Value="%(ConsoleRunners.AssemblyName)" Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"/>
+ <XmlPoke XmlInputPath="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj"
+ Query="//ns:TargetFrameworkVersion"
+ Value="%(ConsoleRunners.TargetFrameworkVersion)" Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"/>
+ <XmlPoke XmlInputPath="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj"
+ Query="//ns:PlatformTarget"
+ Value="%(ConsoleRunners.PlatformTarget)" Namespaces="&lt;Namespace Prefix='ns' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"/>
+ <MSBuild
+ Projects="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj"
+ Targets="Build"
+ Properties="Configuration=$(Configuration);TrackFileAccess=$(TrackFileAccess)"/>
+ <Delete
+ Files="$(SolutionDir)\Source\Runners\Machine.Specifications.ConsoleRunner\Machine.Specifications.ConsoleRunners.%(ConsoleRunners.PlatformTarget).%(ConsoleRunners.TargetFrameworkVersion).csproj" />
+ </Target>
+</Project>
Oops, something went wrong.

2 comments on commit e5364ed

algra commented on e5364ed Jan 10, 2014

Could you, please, update history as well? What was changed in 0.6.2?

Please sign in to comment.