Skip to content

Commit

Permalink
Fixed failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Knopf committed Jan 13, 2013
1 parent 033af12 commit acf65cf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@
<Name>Noodle.Settings</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\Dependencies\mongodb-win32-x86_64-2.2.2\mongod.exe">
<Link>mongod.exe</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<ItemGroup>
<Content Include="..\..\..\Dependencies\mongodb-win32-x86_64-2.2.2\mongod.exe">
<Link>mongod.exe</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
8 changes: 5 additions & 3 deletions Source/Noodle.MongoDB/MongoServerScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ public MongoServerScope(int port) : this(Path.Combine(AppDomain.CurrentDomain.Ba
public MongoServerScope(string directory, int port)
{
_directory = directory;
Trace.WriteLine(directory);

Monitor.Enter(_lockObject);
try
{
_directory = directory;
if (Directory.Exists(directory))
Directory.Delete(directory, true);
Directory.CreateDirectory(directory);
_process =
System.Diagnostics.Process.Start(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mongod.exe"),
"--dbpath \"" + directory + "\" --port \"" + port + "\"");
var mongoPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mongod.exe");
Trace.WriteLine(mongoPath);
_process = System.Diagnostics.Process.Start(mongoPath, "--dbpath \"" + directory + "\" --port \"" + port + "\"");
}
catch (Exception)
{
Expand Down

0 comments on commit acf65cf

Please sign in to comment.