Permalink
Browse files

Removed should library. Has been moved to https://github.com/machine/…

  • Loading branch information...
1 parent 08720de commit 536d0fc68697e99f9ac2f9e651bf50266560426d @danielmarbach danielmarbach committed Jan 23, 2014
Showing with 1 addition and 2,809 deletions.
  1. +0 −12 Machine.Specifications.sln
  2. +0 −9 Misc/machine.specifications.nuspec.template
  3. +0 −277 Source/Machine.Specifications.Should.Specs/AssertionSpecs.cs
  4. +0 −77 Source/Machine.Specifications.Should.Specs/Machine.Specifications.Should.Specs.csproj
  5. +0 −19 Source/Machine.Specifications.Should.Specs/Properties/AssemblyInfo.cs
  6. +0 −450 Source/Machine.Specifications.Should.Specs/ShouldBeLikeSpecs.cs
  7. +0 −182 Source/Machine.Specifications.Should.Specs/Utility/Internal/ErrorMessageSpecs.cs
  8. +0 −189 Source/Machine.Specifications.Should.Specs/Utility/ObjectGraphHelperSpecs.cs
  9. +0 −4 Source/Machine.Specifications.Should.Specs/packages.config
  10. +0 −70 Source/Machine.Specifications.Should/Annotations/ReSharperAttributes.cs
  11. +0 −35 Source/Machine.Specifications.Should/AssertComparer.cs
  12. +0 −26 Source/Machine.Specifications.Should/ComparerStrategies/ComparableComparer.cs
  13. +0 −24 Source/Machine.Specifications.Should/ComparerStrategies/ComparerFactory.cs
  14. +0 −18 Source/Machine.Specifications.Should/ComparerStrategies/ComparisionResult.cs
  15. +0 −13 Source/Machine.Specifications.Should/ComparerStrategies/DefaultComparer.cs
  16. +0 −36 Source/Machine.Specifications.Should/ComparerStrategies/EnumerableComparer.cs
  17. +0 −19 Source/Machine.Specifications.Should/ComparerStrategies/EquatableComparer.cs
  18. +0 −24 Source/Machine.Specifications.Should/ComparerStrategies/GenericTypeComparer.cs
  19. +0 −7 Source/Machine.Specifications.Should/ComparerStrategies/IComparerStrategy.cs
  20. +0 −10 Source/Machine.Specifications.Should/ComparerStrategies/NoResult.cs
  21. +0 −10 Source/Machine.Specifications.Should/ComparerStrategies/ObjectExtension.cs
  22. +0 −14 Source/Machine.Specifications.Should/ComparerStrategies/TypeComparer.cs
  23. +0 −12 Source/Machine.Specifications.Should/ComparerStrategies/TypeExtension.cs
  24. +0 −89 Source/Machine.Specifications.Should/Fody.targets
  25. +0 −4 Source/Machine.Specifications.Should/FodyWeavers.xml
  26. +0 −88 Source/Machine.Specifications.Should/Machine.Specifications.Should.csproj
  27. +0 −18 Source/Machine.Specifications.Should/Properties/AssemblyInfo.cs
  28. +0 −746 Source/Machine.Specifications.Should/ShouldExtensionMethods.cs
  29. +0 −234 Source/Machine.Specifications.Should/Utility/Internal/PrettyPrintingExtensions.cs
  30. +0 −86 Source/Machine.Specifications.Should/Utility/ObjectGraphHelper.cs
  31. +0 −6 Source/Machine.Specifications.Should/packages.config
  32. +1 −1 history.txt
View
@@ -97,10 +97,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.Issue157-Fail", "So
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.Issue157-Success", "Source\Examples\Example.Issue157-Success\Example.Issue157-Success.csproj", "{79F44A49-3516-40F3-AC67-91EFA57B8119}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.Specifications.Should", "Source\Machine.Specifications.Should\Machine.Specifications.Should.csproj", "{4B86A9FC-4D07-40E3-AEB6-2898B5292972}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.Specifications.Should.Specs", "Source\Machine.Specifications.Should.Specs\Machine.Specifications.Should.Specs.csproj", "{B7E595D5-A988-4616-8548-87D3D691D28F}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.NewCustomDelegates", "Source\Examples\Example.NewCustomDelegates\Example.NewCustomDelegates.csproj", "{844788DF-F12F-462F-BDE8-C46F8FFECD12}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Machine.Specifications.ReSharperRunner.8.1", "Source\Runners\Machine.Specifications.ReSharperRunner.8.1\Machine.Specifications.ReSharperRunner.8.1.csproj", "{69C6A07F-2EAD-474C-90A6-3F1DA5A05460}"
@@ -262,14 +258,6 @@ Global
{79F44A49-3516-40F3-AC67-91EFA57B8119}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79F44A49-3516-40F3-AC67-91EFA57B8119}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79F44A49-3516-40F3-AC67-91EFA57B8119}.Release|Any CPU.Build.0 = Release|Any CPU
- {4B86A9FC-4D07-40E3-AEB6-2898B5292972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4B86A9FC-4D07-40E3-AEB6-2898B5292972}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4B86A9FC-4D07-40E3-AEB6-2898B5292972}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4B86A9FC-4D07-40E3-AEB6-2898B5292972}.Release|Any CPU.Build.0 = Release|Any CPU
- {B7E595D5-A988-4616-8548-87D3D691D28F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B7E595D5-A988-4616-8548-87D3D691D28F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B7E595D5-A988-4616-8548-87D3D691D28F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B7E595D5-A988-4616-8548-87D3D691D28F}.Release|Any CPU.Build.0 = Release|Any CPU
{844788DF-F12F-462F-BDE8-C46F8FFECD12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{844788DF-F12F-462F-BDE8-C46F8FFECD12}.Debug|Any CPU.Build.0 = Debug|Any CPU
{844788DF-F12F-462F-BDE8-C46F8FFECD12}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -17,17 +17,14 @@
<references>
<group targetFramework="net45">
<reference file="Machine.Specifications.dll" />
- <reference file="Machine.Specifications.Should.dll" />
<reference file="Machine.Specifications.Clr4.dll" />
</group>
<group targetFramework="net40">
<reference file="Machine.Specifications.dll" />
- <reference file="Machine.Specifications.Should.dll" />
<reference file="Machine.Specifications.Clr4.dll" />
</group>
<group>
<reference file="Machine.Specifications.dll" />
- <reference file="Machine.Specifications.Should.dll" />
</group>
</references>
</metadata>
@@ -38,8 +35,6 @@
<!--<file src="..\Build\@configatron.target@\Machine.Specifications.tdnet" target="lib\net45" />-->
<file src="..\Build\@configatron.target@\Machine.Specifications.Clr4.dll" target="lib\net45" />
<file src="..\Build\@configatron.target@\Machine.Specifications.Clr4.pdb" target="lib\net45" />
- <file src="..\Build\@configatron.target@\Machine.Specifications.Should.dll" target="lib\net45" />
- <file src="..\Build\@configatron.target@\Machine.Specifications.Should.pdb" target="lib\net45" />
<file src="..\Build\@configatron.target@\Machine.Specifications.TDNetRunner.*" target="lib\net45" />
<!-- NET 4.0 -->
@@ -48,16 +43,12 @@
<!--<file src="..\Build\@configatron.target@\Machine.Specifications.tdnet" target="lib\net40" />-->
<file src="..\Build\@configatron.target@\Machine.Specifications.Clr4.dll" target="lib\net40" />
<file src="..\Build\@configatron.target@\Machine.Specifications.Clr4.pdb" target="lib\net40" />
- <file src="..\Build\@configatron.target@\Machine.Specifications.Should.dll" target="lib\net40" />
- <file src="..\Build\@configatron.target@\Machine.Specifications.Should.pdb" target="lib\net40" />
<file src="..\Build\@configatron.target@\Machine.Specifications.TDNetRunner.*" target="lib\net40" />
<!-- NET 2.0 -->
<file src="..\Build\@configatron.target@\Machine.Specifications.dll" target="lib\net20" />
<file src="..\Build\@configatron.target@\Machine.Specifications.pdb" target="lib\net20" />
<!--<file src="..\Build\@configatron.target@\Machine.Specifications.tdnet" target="lib\net20" />-->
- <file src="..\Build\@configatron.target@\Machine.Specifications.Should.dll" target="lib\net20" />
- <file src="..\Build\@configatron.target@\Machine.Specifications.Should.pdb" target="lib\net20" />
<file src="..\Build\@configatron.target@\Machine.Specifications.TDNetRunner.*" target="lib\net20" />
<!-- Sources -->
@@ -1,277 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Machine.Specifications.Should.Specs
-{
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_checking_if_a_collection_contains_elements_that_match_a_func
- {
- static Exception Exception;
- static int[] Ints;
-
- Establish context = () => { Ints = new[] { 1, 2, 3 }; };
-
- Because of = () => { Exception = Catch.Exception(() => Ints.ShouldContain(x => x > 3)); };
-
- It should_print_the_func_description =
- () => Exception.Message.ShouldContain("Should contain elements conforming to: x => (x > 3)");
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_checking_if_a_collection_contains_elements_that_do_not_match_a_func
- {
- static Exception Exception;
- static int[] Ints;
-
- Establish context = () => { Ints = new[] { 1, 2, 3 }; };
-
- Because of = () => { Exception = Catch.Exception(() => Ints.ShouldNotContain(x => x < 3)); };
-
- It should_print_the_func_description =
- () => Exception.Message.ShouldContain("No elements should conform to: x => (x < 3)");
-
- It should_print_the_elements_that_did_not_match =
- () => Exception.Message.ShouldMatch(@"does contain: {\s+\[1\],\s+\[2\]\s+}");
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_checking_if_a_collection_contains_only_elements_that_match_a_func
- {
- static Exception Exception;
- static int[] Ints;
-
- Establish context = () => { Ints = new[] { 1, 2, 3 }; };
-
- Because of = () => { Exception = Catch.Exception(() => Ints.ShouldEachConformTo(x => x % 2 == 0)); };
-
- // Horribly inconsistent here. It seems like this spec might fail because linq expressions returns ((x % 2) = 0)
- // for the original ((x % 2) == 0).
-
- It should_print_the_func_description =
- () => Exception.Message.ShouldContain("Should contain only elements conforming to: x => ((x % 2) = 0)");
-
- It should_print_the_elements_that_did_not_match =
- () => Exception.Message.ShouldMatch(@"the following items did not meet the condition: {\s+\[1\],\s+\[3\]\s+}");
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_a_list_contains_an_element_of_another_list
- {
- static Exception SpecException;
- static List<string> AList;
- static List<string> AnotherList;
- static string Element;
-
- Establish context = () =>
- {
- Element = "An Element";
- AList = new List<string> { Element };
- AnotherList = new List<string>(AList);
- };
-
- Because of =
- () => SpecException = Catch.Exception(() => AList.ShouldContain(AnotherList));
-
- It should_pass_the__ShouldContains__assertion =
- () => SpecException.ShouldBeNull();
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_a_list_not_contains_an_element_of_another_list
- {
- static Exception SpecException;
- static List<string> AList;
- static List<string> AnotherList;
- static string Element;
- static string AnotherElement;
-
- Establish context = () =>
- {
- Element = "An Element";
- AList = new List<string> { Element };
-
- AnotherElement = "Another Element";
- AnotherList = new List<string> { AnotherElement };
- };
-
- Because of =
- () => SpecException = Catch.Exception(() => AList.ShouldContain(AnotherList));
-
- It should_fail_the__ShouldContains__assertion =
- () => SpecException.ShouldBeOfType<SpecificationException>();
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_a_null_string_is_asserted_on
- {
- static string AString;
-
- Establish context =
- () => AString = null;
-
- It should_fail_the__ShouldBeEmpty__assertion =
- () => Catch.Exception(() => AString.ShouldBeEmpty()).ShouldBeOfType<SpecificationException>();
-
- It should_fail_the__ShouldNotBeEmpty__assertion =
- () => Catch.Exception(() => AString.ShouldNotBeEmpty()).ShouldBeOfType<SpecificationException>();
-
- It should_pass_the__ShouldBeNull__assertion =
- () => Catch.Exception(() => AString.ShouldBeNull()).ShouldBeNull();
-
- It should_fail_the__ShouldNotBeNull__assertion =
- () => Catch.Exception(() => AString.ShouldNotBeNull()).ShouldBeOfType<SpecificationException>();
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_an_empty_string_is_asserted_on
- {
- static string AString;
-
- Establish context =
- () => AString = "";
-
- It should_pass_the__ShouldBeEmpty__assertion =
- () => Catch.Exception(() => AString.ShouldBeEmpty()).ShouldBeNull();
-
- It should_fail_the__ShouldNotBeEmpty__assertion =
- () => Catch.Exception(() => AString.ShouldNotBeEmpty()).ShouldBeOfType<SpecificationException>();
-
- It should_fail_the__ShouldBeNull__assertion =
- () => Catch.Exception(() => AString.ShouldBeNull()).ShouldBeOfType<SpecificationException>();
-
- It should_pass_the__ShouldNotBeNull__assertion =
- () => Catch.Exception(() => AString.ShouldNotBeNull()).ShouldBeNull();
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_an_non_empty_string_is_asserted_on
- {
- static string AString;
-
- Establish context =
- () => AString = "hey";
-
- It should_fail_the__ShouldBeEmpty__assertion =
- () => Catch.Exception(() => AString.ShouldBeEmpty()).ShouldBeOfType<SpecificationException>();
-
- It should_pass_the__ShouldNotBeEmpty__assertion =
- () => Catch.Exception(() => AString.ShouldNotBeEmpty()).ShouldBeNull();
-
- It should_fail_the__ShouldBeNull__assertion =
- () => Catch.Exception(() => AString.ShouldBeNull()).ShouldBeOfType<SpecificationException>();
-
- It should_pass_the__ShouldNotBeNull__assertion =
- () => Catch.Exception(() => AString.ShouldNotBeNull()).ShouldBeNull();
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_a_type_assertion_fails
- {
- static string AString;
- static SpecificationException Exception;
-
- Establish context = () => { AString = null; };
-
- Because of =
- () => Exception = (SpecificationException)Catch.Exception(() => AString.ShouldBeOfType<int>());
-
- It should_report_the_requested_type =
- () => Exception.Message.ShouldStartWith("Should be of type System.Int32");
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_checking_if_an_item_matches_a_func
- {
- static Exception Exception;
- static int Int;
-
- Establish context = () => { Int = 42; };
-
- Because of = () => { Exception = Catch.Exception(() => Int.ShouldMatch(x => x > 1)); };
-
- It should_succeed =
- () => Exception.ShouldBeNull();
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_checking_if_an_item_matches_a_func_and_the_check_fails
- {
- static Exception Exception;
- static int Int;
-
- Establish context = () => { Int = 42; };
-
- Because of = () => { Exception = Catch.Exception(() => Int.ShouldMatch(x => x > 50)); };
-
- It should_print_the_func_description =
- () => Exception.Message.ShouldContain("Should match expression [x => (x > 50)], but does not.");
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_comparing_different_classes_with_equals_for_equality
- {
- Because of = () => FiveFrancs = new Franc(5, "CHF");
- It should_equal_money_with_currency_set_to_francs = () => FiveFrancs.Equals(new Money(5, "CHF")).ShouldBeTrue();
- static Franc FiveFrancs;
- }
-
- [Subject(typeof(ShouldExtensionMethods))]
- public class when_comparing_different_classes_with_should_equal_for_equality
- {
- Because of = () => FiveFrancs = new Franc(5, "CHF");
- It should_be_ten_francs_when_multiplied_by_2 = () => FiveFrancs.Times(2).ShouldEqual(Money.Franc(10));
- It should_be_fifteen_francs_when_multiplied_by_3 = () => FiveFrancs.Times(3).ShouldEqual(Money.Franc(15));
- static Franc FiveFrancs;
- }
-
- public class Money : IEquatable<Money>
- {
- readonly int _amount;
- readonly string _currency;
-
- public Money(int amount, string currency)
- {
- _amount = amount;
- _currency = currency;
- }
-
- public Money Times(int multiplier)
- {
- return new Money(multiplier * _amount, _currency);
- }
-
- public static Money Franc(int amount)
- {
- return new Franc(amount, "CHF");
- }
-
- public bool Equals(Money other)
- {
- return _amount == other._amount && _currency == other._currency;
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj))
- return false;
- if (ReferenceEquals(this, obj))
- return true;
- return Equals(obj as Money);
- }
-
- public override int GetHashCode()
- {
- unchecked
- {
- return (_amount * 997) ^ _currency.GetHashCode();
- }
- }
- }
-
- public class Franc : Money
- {
- public Franc(int amount, string currency) : base(amount, currency)
- {
- }
- }
-}
Oops, something went wrong.

28 comments on commit 536d0fc

Hy matt,
Do you care to explain what caused problems? The statement "This caused a lot of problems for us" doesn't really help me improve for future version. MSpec has never reached 1.0. I'm constantly moving towards 1.0. During the meantime I consider breaking changes a necessary evil. I try to add proper obsoletes where possible.

Front/page?

Ah found it, you mean the README. Thanks for the hint

Apologies for the outburst, I completely understand the necessity of breaking changes.
Specifically the problem that people may face is that an innocuous 'update package' in NuGet can now cause their builds to start failing, with no obvious hint that they need to import a new package.

We decided to exclude the Shoulds from the core MSpec because the extension methods pollute the intellisense in Visual Studio.
I certainly can see the point that a new user will install the MSpec package and not the Should package and will be surprised. But unfortunately, it's the only way so that you have a change to not have the Shoulds :-(

We surely need to document this clearly with examples!

Thanks for pointing at this problem.

Owner

agross replied Feb 18, 2014

why not a MSpec.Core, MSpec.Should and a MSpec (which depends on Core and Should) Package for compatibility.

I recommend deliberately setting both the min & max version range, as a safeguard, especially if you're following semver (what exactly is the scheme here?). For example, in nuspec format, version="[0.7, 1.0)".

We just don't want to maintain a Should library when there are dedicated libraries for that task out there. This makes just no sense regarding the little spare time we have to maintain MSpec.

We don't even suggest using the MSpec Shoulds, there are better alternatives. Therefore, we do not want to have them in the package named MSpec.

I completely agree that this is a big breaking change. But it is a necessary step in order to go faster in the future. MSpec was 0.x for much too long. Resulting in exactly this confusion of end users, lots of examples showing "old" stuff. We definitely need a web page for MSpec showing how to use it (with or without Should). But this needs time, time we don't have plenty.

Oh you guys have really done it now ;) -- http://stackoverflow.com/questions/21916387

Please sign in to comment.