Merge pull request #68 from monae/patch-timezone
Fix broken test which depends on local timezone
This commit is contained in:
@@ -14,6 +14,7 @@ import java.util.Collections;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
@@ -384,6 +385,9 @@ public class MustacheTest
|
|||||||
else return String.valueOf(value);
|
else return String.valueOf(value);
|
||||||
}
|
}
|
||||||
protected SimpleDateFormat _fmt = new SimpleDateFormat("yyyy/MM/dd");
|
protected SimpleDateFormat _fmt = new SimpleDateFormat("yyyy/MM/dd");
|
||||||
|
{
|
||||||
|
_fmt.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
check("Date: 2014/01/08", Mustache.compiler().withFormatter(fmt).
|
check("Date: 2014/01/08", Mustache.compiler().withFormatter(fmt).
|
||||||
compile("{{msg}}: {{today}}").execute(new Object() {
|
compile("{{msg}}: {{today}}").execute(new Object() {
|
||||||
|
|||||||
Reference in New Issue
Block a user