Skip to content

Commit

Permalink
Checkpoint: Can read/write from object blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarnold committed Oct 22, 2013
1 parent 33041a9 commit 5e138fb
Show file tree
Hide file tree
Showing 33 changed files with 787 additions and 602 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -23,3 +23,4 @@ ripple_exe
*.gem
Gemfile.lock
src/ripple.Docs/pak-WebContent.zip
*.orig
2 changes: 1 addition & 1 deletion ripple.config
Expand Up @@ -15,7 +15,7 @@
<Nugets>
<Dependency Name="Bottles" Version="2.0.0.550" Mode="Float" />
<Dependency Name="FubuCore" Version="1.1.0.242" Mode="Float" />
<Dependency Name="FubuObjectBlocks" Version="0.1.0.5" Mode="Float" />
<Dependency Name="FubuObjectBlocks" Version="0.1.0.7" Mode="Float" />
<Dependency Name="Nuget.Core" Version="2.5" Mode="Fixed" />
<Dependency Name="NUnit" Version="2.5.10.11092" Mode="Fixed" />
<Dependency Name="RhinoMocks" Version="3.6.1" Mode="Fixed" />
Expand Down
170 changes: 72 additions & 98 deletions src/ripple.Testing/Commands/InitInputTester.cs
@@ -1,99 +1,73 @@
using FubuTestingSupport;
using NUnit.Framework;
using ripple.Commands;
using ripple.Model;

namespace ripple.Testing.Commands
{
[TestFixture]
public class InitInputTester
{
private InitInput theInput;

[SetUp]
public void SetUp()
{
theInput = new InitInput();
}

private Solution theSolution { get { return theInput.ToSolution(); } }

[Test]
public void sets_the_name()
{
theInput.Name = "Test";
theSolution.Name.ShouldEqual(theInput.Name);
}

[Test]
public void default_src_folder()
{
theSolution.SourceFolder.ShouldEqual("src");
}

[Test]
public void custom_src_folder()
{
theInput.SourceFolderFlag = "source";
theSolution.SourceFolder.ShouldEqual(theInput.SourceFolderFlag);
}

[Test]
public void default_nuspec_folder()
{
theSolution.NugetSpecFolder.ShouldEqual("packaging/nuget");
}

[Test]
public void custom_nuspec_folder()
{
theInput.NuspecFolderFlag = "nuspecs";
theSolution.NugetSpecFolder.ShouldEqual(theInput.NuspecFolderFlag);
}

[Test]
public void default_build_command()
{
theSolution.BuildCommand.ShouldEqual("rake");
}

[Test]
public void custom_build_command()
{
theInput.BuildCommandFlag = "psake";
theSolution.BuildCommand.ShouldEqual(theInput.BuildCommandFlag);
}

[Test]
public void default_fast_build_command()
{
theSolution.FastBuildCommand.ShouldEqual("rake compile");
}

[Test]
public void custom_fast_build_command()
{
theInput.FastBuildCommandFlag = "psake compile";
theSolution.FastBuildCommand.ShouldEqual(theInput.FastBuildCommandFlag);
}

[Test]
public void default_feeds()
{
theSolution.Feeds.ShouldHaveTheSameElementsAs(Feed.Fubu, Feed.NuGetV2);
}

[Test]
public void custom_feeds()
{
theInput.FeedsFlag = "test1#test2";
theSolution.Feeds.ShouldHaveTheSameElementsAs(new Feed("test1"), new Feed("test2"));
}

[Test]
public void default_cache()
{
theSolution.NugetCacheDirectory.ShouldBeNull();
}
}
using FubuTestingSupport;
using NUnit.Framework;
using ripple.Commands;
using ripple.Model;

namespace ripple.Testing.Commands
{
[TestFixture]
public class InitInputTester
{
private InitInput theInput;

[SetUp]
public void SetUp()
{
theInput = new InitInput();
}

private Solution theSolution { get { return theInput.ToSolution(); } }

[Test]
public void sets_the_name()
{
theInput.Name = "Test";
theSolution.Name.ShouldEqual(theInput.Name);
}

[Test]
public void default_src_folder()
{
theSolution.SourceFolder.ShouldEqual("src");
}

[Test]
public void custom_src_folder()
{
theInput.SourceFolderFlag = "source";
theSolution.SourceFolder.ShouldEqual(theInput.SourceFolderFlag);
}

[Test]
public void default_nuspec_folder()
{
theSolution.NugetSpecFolder.ShouldEqual("packaging/nuget");
}

[Test]
public void custom_nuspec_folder()
{
theInput.NuspecFolderFlag = "nuspecs";
theSolution.NugetSpecFolder.ShouldEqual(theInput.NuspecFolderFlag);
}

[Test]
public void default_feeds()
{
theSolution.Feeds.ShouldHaveTheSameElementsAs(Feed.Fubu, Feed.NuGetV2);
}

[Test]
public void custom_feeds()
{
theInput.FeedsFlag = "test1#test2";
theSolution.Feeds.ShouldHaveTheSameElementsAs(new Feed("test1"), new Feed("test2"));
}

[Test]
public void default_cache()
{
theSolution.NugetCacheDirectory.ShouldBeNull();
}
}
}
18 changes: 9 additions & 9 deletions src/ripple.Testing/Commands/UpdateInputTester.cs
Expand Up @@ -78,10 +78,10 @@ public void requests_for_entire_solution()
public void requests_for_a_single_dependency_in_a_group()
{
var group = new DependencyGroup();
group.Dependencies.Add(new GroupedDependency("FubuCore"));
group.Dependencies.Add(new GroupedDependency("FubuLocalization"));
group.Add(new GroupedDependency("FubuCore"));
group.Add(new GroupedDependency("FubuLocalization"));

theSolution.Groups.Add(group);
theSolution.AddGroup(group);
theInput.NugetFlag = "FubuCore";

var requests = theInput.Requests(theSolution).ToArray();
Expand All @@ -97,14 +97,14 @@ public void requests_for_a_single_dependency_in_a_group()
public void requests_for_a_single_dependency_in_multiple_groups()
{
var g1 = new DependencyGroup();
g1.Dependencies.Add(new GroupedDependency("FubuCore"));
g1.Dependencies.Add(new GroupedDependency("FubuLocalization"));
theSolution.Groups.Add(g1);
g1.Add(new GroupedDependency("FubuCore"));
g1.Add(new GroupedDependency("FubuLocalization"));
theSolution.AddGroup(g1);

var g2 = new DependencyGroup();
g2.Dependencies.Add(new GroupedDependency("FubuLocalization"));
g2.Dependencies.Add(new GroupedDependency("Bottles"));
theSolution.Groups.Add(g2);
g2.Add(new GroupedDependency("FubuLocalization"));
g2.Add(new GroupedDependency("Bottles"));
theSolution.AddGroup(g2);

theInput.NugetFlag = "FubuCore";

Expand Down
Expand Up @@ -30,8 +30,8 @@ public void SetUp()
});
});

theSolution = theScenario.Find("Test");
theSolution.Nuspecs.Add(new NuspecMap { File = "SomethingElse.nuspec", Project = "Something"});
theSolution = theScenario.Find("Test");
theSolution.AddNuspec(new NuspecMap { File = "SomethingElse.nuspec", Project = "Something" });

theInput = new CreatePackagesInput
{
Expand Down
Expand Up @@ -43,7 +43,7 @@ public void SetUp()
theSolution = theScenario.Find("Test");

// Map Something.nuspec to the "JustToBeComplicated" project
theSolution.Nuspecs.Add(new NuspecMap { File = "Something.nuspec", Project = "JustToBeComplicated" });
theSolution.AddNuspec(new NuspecMap { File = "Something.nuspec", Project = "JustToBeComplicated" });

var someProject = theSolution.FindProject("SomeProject");
var justToBeComplicated = theSolution.FindProject("JustToBeComplicated");
Expand Down
72 changes: 36 additions & 36 deletions src/ripple.Testing/Model/DependencyGroupTester.cs
@@ -1,37 +1,37 @@
using FubuTestingSupport;
using NUnit.Framework;
using ripple.Model;

namespace ripple.Testing.Model
{
[TestFixture]
public class DependencyGroupTester
{
[Test]
public void has_dependency_positive()
{
var group = new DependencyGroup();
group.Dependencies.Add(new GroupedDependency("FubuCore"));

group.Has("FubuCore").ShouldBeTrue();
}

[Test]
public void has_dependency_case_insensitive()
{
var group = new DependencyGroup();
group.Dependencies.Add(new GroupedDependency("FubuCore"));

group.Has("fubuCore").ShouldBeTrue();
}

[Test]
public void has_dependency_negative()
{
var group = new DependencyGroup();
group.Dependencies.Add(new GroupedDependency("FubuCore"));

group.Has("Bottles").ShouldBeFalse();
}
}
using FubuTestingSupport;
using NUnit.Framework;
using ripple.Model;

namespace ripple.Testing.Model
{
[TestFixture]
public class DependencyGroupTester
{
[Test]
public void has_dependency_positive()
{
var group = new DependencyGroup();
group.Add(new GroupedDependency("FubuCore"));

group.Has("FubuCore").ShouldBeTrue();
}

[Test]
public void has_dependency_case_insensitive()
{
var group = new DependencyGroup();
group.Add(new GroupedDependency("FubuCore"));

group.Has("fubuCore").ShouldBeTrue();
}

[Test]
public void has_dependency_negative()
{
var group = new DependencyGroup();
group.Add(new GroupedDependency("FubuCore"));

group.Has("Bottles").ShouldBeFalse();
}
}
}
68 changes: 33 additions & 35 deletions src/ripple.Testing/Model/SolutionPersistence.cs
@@ -1,36 +1,34 @@
using NUnit.Framework;
using ripple.Model;

namespace ripple.Testing.Model
{
[TestFixture]
public class SolutionPersistence
{
[Test]
public void persists_and_retrieves_the_solution()
{
var solution = new Solution
{
Name = "Test",
BuildCommand = "rake",
FastBuildCommand = "rake compile",
Feeds = new[] { Feed.NuGetV2, Feed.NuGetV1 },
Nugets = new[] { new Dependency("FubuCore", "1.0.1.0") }
};

var group = new DependencyGroup();
group.Dependencies.Add(new GroupedDependency("FubuCore"));
solution.Groups.Add(group);

var constrainedDependency = new Dependency("Bottles", "1.0.0.0")
{
VersionConstraint = VersionConstraint.DefaultFloat
};
solution.AddDependency(constrainedDependency);

solution.Nuspecs.Add(new NuspecMap { File = "Temp", Project = "Test"});

CheckXmlPersistence.For(solution);
}
}
using NUnit.Framework;
using ripple.Model;

namespace ripple.Testing.Model
{
[TestFixture]
public class SolutionPersistence
{
[Test]
public void persists_and_retrieves_the_solution()
{
var solution = new Solution
{
Name = "Test",
Feeds = new[] { Feed.NuGetV2, Feed.NuGetV1 },
Nugets = new[] { new Dependency("FubuCore", "1.0.1.0") }
};

var group = new DependencyGroup();
group.Add(new GroupedDependency("FubuCore"));
solution.AddGroup(group);

var constrainedDependency = new Dependency("Bottles", "1.0.0.0")
{
VersionConstraint = VersionConstraint.DefaultFloat
};
solution.AddDependency(constrainedDependency);

solution.AddNuspec(new NuspecMap { File = "Temp", Project = "Test" });

CheckXmlPersistence.For(solution);
}
}
}
2 changes: 1 addition & 1 deletion src/ripple.Testing/Model/Xml/XmlSolutionLoaderTester.cs
Expand Up @@ -94,7 +94,7 @@ public void groups()
group.Has("Dependency1").ShouldBeTrue();
group.Has("Dependency2").ShouldBeTrue();

group.Dependencies.ShouldHaveCount(2);
group.GroupedDependencies.ShouldHaveCount(2);
}

[Test]
Expand Down

0 comments on commit 5e138fb

Please sign in to comment.