Permalink
Browse files

Fixing tests & updating version number.

  • Loading branch information...
skroonenburg committed Sep 29, 2011
1 parent fa9f765 commit 042a3f224b1413d1a2c87efeb2ad809a40b687fd
View
Binary file not shown.
View
@@ -2,7 +2,7 @@
<package>
<metadata>
<id>Rejuicer</id>
- <version>1.2.0</version>
+ <version>1.2.1</version>
<authors>Sam Kroonenburg</authors>
<description>Minify your CSS/JS. Simple fluent configuration. Wildcard file matching. Works on Azure. Easy script debugging.</description>
<language>en-US</language>
@@ -15,7 +15,7 @@ public class DefaultCssTransformerTest
{
private string TransformCss(string css, Func<string, string> replacement)
{
- return new DefaultCssTransformer(new StubVirtualPathResolver(replacement)).TransformFile(new PhysicalFileSource(ResourceType.Css, Mode.Minify, "~/test.css", "test.css"), css.AsStream()).ReadString();
+ return new DefaultCssTransformer(new StubVirtualPathResolver(replacement)).TransformFile(new PhysicalFileSource(ResourceType.Css, "~/test.css", "test.css", Mode.Minify), css.AsBytes()).ReadString();
}
[Test]
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;
@@ -14,6 +15,9 @@ public class FluentConfigurerTests
public void Setup()
{
RejuicerEngine._configurations.Clear();
+
+ WildcardMatchFileRule.VirtualPathResolver = new StubVirtualPathResolver();
+ SingleFileRule.VirtualPathResolver = new StubVirtualPathResolver();
}
private RejuicerConfigurationSource GetModelFor(object configurer)
@@ -71,5 +75,33 @@ public void FluentConfiguration_Configure_AddsRejuicerModelToConfiguration()
Assert.AreEqual(1, RejuicerEngine._configurations.Count);
}
+
+ public class StubVirtualPathResolver : IVirtualPathResolver
+ {
+ public DirectoryInfo ResolveVirtualPathToDirectory(string virtualPath)
+ {
+ return null;
+ }
+
+ public FileInfo ResolveVirtualPathToFile(string virtualPath)
+ {
+ return null;
+ }
+
+ public string ResolveVirtualPath(string virtualPath)
+ {
+ return null;
+ }
+
+ public string GetRelativeUrl(string virtualPath)
+ {
+ return null;
+ }
+
+ public string GetVirtualPathFor(FileInfo file)
+ {
+ return null;
+ }
+ }
}
}
@@ -32,7 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.2.0.0")]
-[assembly: AssemblyFileVersion("1.2.0.0")]
+[assembly: AssemblyVersion("1.2.1.0")]
+[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: InternalsVisibleTo("Rejuicer-test")]
[assembly: InternalsVisibleTo("RejuicerConfiguration-test")]
@@ -9,16 +9,24 @@ namespace Rejuicer.Model
// A rule for including a single file. Immutable.
internal sealed class SingleFileRule : IContentSourceRule
{
- public static IVirtualPathResolver VirtualPathResolver { get; private set; }
+ public static IVirtualPathResolver VirtualPathResolver { get; internal set; }
+
+ static SingleFileRule()
+ {
+ VirtualPathResolver = new VirtualPathResolver();
+ }
public SingleFileRule(string virtualPath, Mode mode)
- : this(virtualPath, mode, new VirtualPathResolver())
+ : this(virtualPath, mode, null)
{}
public SingleFileRule(string virtualPath, Mode mode, IVirtualPathResolver virtualPathResolver)
{
VirtualPath = virtualPath;
- VirtualPathResolver = virtualPathResolver;
+ if (virtualPathResolver != null)
+ {
+ VirtualPathResolver = virtualPathResolver;
+ }
Mode = mode;
}
@@ -10,19 +10,29 @@ namespace Rejuicer.Model
// A rule for including multiple files with a wildcard match. Immutable.
internal sealed class WildcardMatchFileRule : IContentSourceRule
{
- public static IVirtualPathResolver VirtualPathResolver { get; private set; }
+ public static IVirtualPathResolver VirtualPathResolver { get; internal set; }
+
+ static WildcardMatchFileRule()
+ {
+ VirtualPathResolver = new VirtualPathResolver();
+ }
public WildcardMatchFileRule(string folderVirtualPath, string searchPattern, bool recursive, Mode mode, IVirtualPathResolver virtualPathResolver)
{
FolderVirtualPath = folderVirtualPath;
SearchPattern = searchPattern;
IsRecursive = recursive;
- VirtualPathResolver = virtualPathResolver;
+
+ if (virtualPathResolver != null)
+ {
+ VirtualPathResolver = virtualPathResolver;
+ }
+
Mode = mode;
}
public WildcardMatchFileRule(string folderVirtualPath, string searchPattern, bool recursive, Mode mode)
- : this(folderVirtualPath, searchPattern, recursive, mode, new VirtualPathResolver())
+ : this(folderVirtualPath, searchPattern, recursive, mode, null)
{
}
@@ -3,5 +3,5 @@
<configSections>
<section name="rejuicer" type="Rejuicer.Configuration.RejuicerConfiguration, Rejuicer"/>
</configSections>
- <rejuicer Cache="true" PreventPassThroughOnDebug="true" />
+ <rejuicer PreventPassThroughOnDebug="true" />
</configuration>

0 comments on commit 042a3f2

Please sign in to comment.