Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add short README, clean up doc/samples

  • Loading branch information...
commit 513bc55e8a2726dfdf78bd258b89e726a57f8ce9 1 parent eaac75c
Christian Johansen authored
View
3  .gitignore
@@ -1 +1,2 @@
-buster-browser.js
+buster-test.js
+doc/samples/buster-test.js
View
14 README
@@ -0,0 +1,14 @@
+This project is just wiring of individual buster projects. It has no unit tests
+for this wiring, but the doc/samples directory includes some test cases that can
+be run both on node and in browsers to verify that it works. To run on node,
+simply do
+
+ node doc/samples/test-case.js
+ node doc/samples/spec.js
+ node doc/samples/strftime.js
+
+To run in browsers:
+
+ ./build
+
+And then load the HTML files in doc/samples in a browser.
View
9 build
@@ -9,6 +9,7 @@ cat node_modules/buster-core/lib/buster-core.js \
node_modules/buster-core/lib/buster-event-emitter.js \
node_modules/buster-format/lib/buster-format.js \
node_modules/buster-assert/lib/buster-assert.js \
+ node_modules/buster-assert/lib/buster-assert/assert-that.js \
node_modules/buster-promise/lib/buster-promise.js \
node_modules/buster-evented-logger/lib/buster-evented-logger.js \
node_modules/buster-test/lib/buster-test/stack-filter.js \
@@ -20,10 +21,10 @@ cat node_modules/buster-core/lib/buster-core.js \
node_modules/buster-test/lib/buster-test.js \
node_modules/sinon/pkg/sinon-1.* \
node_modules/sinon-buster/lib/sinon-buster.js \
- lib/buster.js > buster-browser.js
+ lib/buster.js > buster-test.js
echo "if (buster.stackFilter && buster.stackFilter.filters) {
- buster.stackFilter.filters.push('buster-browser.js');
-}" >> buster-browser.js
+ buster.stackFilter.filters.push('buster-test.js');
+}" >> buster-test.js
-echo "Generated buster-browser.js"
+echo "Generated buster-test.js"
View
1  doc/samples/buster-test.css
View
24 doc/samples/spec.html
@@ -3,18 +3,26 @@
<head>
<title>Buster.JS Spec</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" type="text/css" href="../../resources/buster-test.css">
- <style type="text/css">
- #buster {
- border: 2px solid #000;
- width: 400px;
- }
- </style>
</head>
<body>
<h1>Buster.JS Spec</h1>
+ <p>
+ This test sample runs in embedded mode - i.e., it only styles it self and
+ does not assume it's alone on the page. Use for running tests inside your
+ app.
+ </p>
+ <p>
+ To embed the runner, simply create an element with id "buster", and buster
+ will figure out the rest. Note that if you want the buster-test styling,
+ you have to manually include the CSS file (found in
+ <a href="../../resources/buster-test.css">resources/buster-test.css</a>).
+ </p>
+ <p>
+ For more fine-grained control, you can instantiate and configure your own
+ runner, see documentation for buster-test/runner.
+ </p>
<div id="buster"></div>
- <script type="text/javascript" src="../../buster-browser.js"></script>
+ <script type="text/javascript" src="buster-test.js"></script>
<script type="text/javascript" src="spec.js"></script>
</body>
</html>
View
1  doc/samples/strftime-test.js
@@ -1,5 +1,6 @@
if (typeof require != "undefined") {
var buster = require("../../lib/buster");
+ require("./strftime");
}
var assert = buster.assert;
View
3  doc/samples/strftime.html
@@ -3,12 +3,11 @@
<head>
<title>Buster.JS strftime Test case</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" type="text/css" href="../../resources/buster-test.css">
</head>
<body>
<h1>Buster.JS strftime Test case</h1>
+ <script type="text/javascript" src="buster-test.js"></script>
<script type="text/javascript" src="strftime.js"></script>
- <script type="text/javascript" src="../../buster-browser.js"></script>
<script type="text/javascript" src="strftime-test.js"></script>
</body>
</html>
View
3  doc/samples/test-case.html
@@ -3,11 +3,10 @@
<head>
<title>Buster.JS Test case</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link rel="stylesheet" type="text/css" href="../../resources/buster-test.css">
</head>
<body>
<h1>Buster.JS Test case</h1>
- <script type="text/javascript" src="../../buster-browser.js"></script>
+ <script type="text/javascript" src="buster-test.js"></script>
<script type="text/javascript" src="test-case.js"></script>
</body>
</html>
View
596 resources/buster-test.css
@@ -6,25 +6,26 @@ html.buster-test {
.buster-test,
body.buster-test {
- background: #f0f0f0;
- font-family: Arial, sans-serif;
- font-size: 100%;
+ /* background: #f0f0f0; */
+ /* font-family: Arial, sans-serif; */
+ /* font-size: 100%; */
padding: 0 12px;
}
-.buster-test h1 {
- background: #4e4e4e;
- background: -webkit-gradient(linear, left top, left bottom, from(#787878), to(#4e4e4e));
- background: -moz-linear-gradient(top center, #787878, #4e4e4e);
- border-bottom: 4px solid #eeee80;
- color: #fff;
- font-weight: normal;
- margin: 0 -12px .25em;
- padding: .5em;
- z-index: 1;
-}
+/* .buster-test h1 { */
+/* background: #4e4e4e; */
+/* background: -webkit-gradient(linear, left top, left bottom, from(#787878), to(#4e4e4e)); */
+/* background: -moz-linear-gradient(top center, #787878, #4e4e4e); */
+/* border-bottom: 4px solid #eeee80; */
+/* color: #fff; */
+/* font-weight: normal; */
+/* margin: 0 -12px .25em; */
+/* padding: .5em; */
+/* z-index: 1; */
+/* } */
.buster-test h2 {
+ display: inline-block;
font-weight: normal;
}
@@ -33,11 +34,16 @@ body.buster-test {
padding: 0;
}
+.buster-test ul + ul {
+ margin-top: -1em;
+}
+
.buster-test ul li {
list-style: none;
}
.buster-test li h3 {
+ display: inline-block;
font-size: 1em;
margin: 0 0 .25em;
padding: 0;
@@ -50,7 +56,13 @@ body.buster-test {
}
.buster-test .success h3 {
+ /*color: #3c3;*/
+}
+
+.buster-test .success h3:before {
color: #3c3;
+ content: "";
+ padding-right: 6px;
}
.buster-test .timeout h3,
@@ -62,10 +74,21 @@ body.buster-test {
color: #cc3;
}
+.buster-test .failure h3:before,
+.buster-test .error h3:before {
+ content: "";
+ padding-right: 6px;
+}
+
.buster-test .deferred h3 {
color: #33c;
}
+.buster-test .deferred h3:before {
+ content: "";
+ padding-right: 6px;
+}
+
.buster-test .stats ul {
margin: 0 0 1em;
}
@@ -77,4 +100,549 @@ body.buster-test {
.buster-test .stats li {
display: inline;
padding-right: 1em;
+}
+
+/* buster-test.css */
+* {
+ border: none;
+ margin: 0;
+ outline: none;
+ padding: 0;
+}
+
+html,
+body {
+ font-family: Georgia, Times, serif;
+ font-size: 100%;
+ margin: 0 auto;
+}
+
+p,
+li {
+ line-height: 1.5;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+p {
+ font-weight: normal;
+ margin: 0 0 1em;
+}
+
+ul {
+ margin: 0 0 1em 15px;
+}
+
+img {
+ display: block;
+}
+
+h1 {
+ border-bottom: 1px solid #ddd;
+ font-size: 3em;
+ margin: 0 0 .25em;
+}
+
+h2 {
+ border-bottom: 1px solid #eee;
+ font-size: 2em;
+ margin: 0 0 0.75em;
+}
+
+h3 {
+ border-bottom: 1px solid #f0f0f0;
+ /*display: inline-block;*/
+ font-size: 1.25em;
+ line-height: 1.5;
+ margin: 0 0 0.5em;
+}
+
+h4 {
+ font-size: 1em;
+ font-weight: bold;
+ margin: 0 0 0.25em;
+}
+
+h2 .pilcrow_anchor,
+h3 .pilcrow_anchor {
+ display: none;
+ color: #666;
+ text-decoration: none;
+ padding-left: .2em;
+}
+
+h2:hover .pilcrow_anchor,
+h3:hover .pilcrow_anchor {
+ display: inline;
+}
+
+dl {
+ margin: 0 0 1.5em;
+ overflow: auto;
+}
+
+dt,
+dd {
+ float: left;
+ line-height: 1.5;
+}
+
+dt {
+ clear: left;
+ font-weight: bold;
+ width: 7em;
+}
+
+ol {
+ margin: 0 0 1.5em 25px;
+}
+
+ol li {
+ margin: 0 0 0.5em;
+}
+
+table {
+ border-collapse: collapse;
+ margin: 0 0 1.5em;
+}
+
+td,
+th {
+ border: none;
+}
+
+th {
+ padding: 0 12px 0 0;
+}
+
+.nav {
+ margin: 0;
+}
+
+.nav li {
+ list-style: none;
+}
+
+a:hover {
+ text-decoration: none;
+}
+
+a img {
+ border: none;
+ outline: none;
+}
+
+.button {
+ background: #ddd;
+
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#fff),
+ to(#ddd)
+ );
+
+ background: -moz-linear-gradient(
+ top center,
+ #fff,
+ #ddd
+ );
+
+ border: 1px solid #aaa;
+ border-radius: 12px;
+ -moz-border-radius: 24px;
+ -webkit-border-radius: 24px;
+ box-shadow: 2px 2px 2px #ccc;
+ -webkit-box-shadow: 2px 2px 2px #ccc;
+ -moz-box-shadow: 2px 2px 2px #ccc;
+ display: inline-block;
+ margin: 0 0 2em;
+}
+
+.button:hover {
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#cdcdcd),
+ to(#ececec)
+ );
+
+ background: -moz-linear-gradient(
+ top center,
+ #cdcdcd,
+ #ececec
+ );
+
+ border-color: #999;
+}
+
+.button a,
+.button input {
+ background: none;
+ border: none;
+ cursor: pointer;
+ display: block;
+ font-size: 1.2em;
+ font-weight: normal;
+ outline: none;
+ padding: 2px 24px;
+ text-decoration: none;
+}
+
+code {
+/*"Bitstream Vera Sans Mono"?*/
+ font-family: "Droid Sans Mono", "Liberation Mono", Courier, monospace;
+ font-size: 0.9em;
+}
+
+p code,
+li code {
+ border-radius: 6px;
+ padding: 2px;
+ white-space: nowrap;
+}
+
+.msg p code,
+.msg li code {
+ background: #f6f9fc;
+}
+
+code .keyword { font-weight: bold; }
+code .string, code .regexp { color: red; }
+code .class, code .special { font-weight: bold; }
+code .number { font-weight: bold; }
+code .comment { color: grey; }
+
+pre code,
+.side-by-side {
+ background: #f6f9fc;
+ border: 1px solid #ddd;
+ border-radius: 6px;
+ -moz-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ display: block;
+ margin: 0 0 1.5em;
+ padding: 12px;
+}
+
+pre code {
+ font-size: 14px;
+}
+
+.long-lines code {
+ font-size: 11px;
+}
+
+/* Side-by-side code views */
+.side-by-side {
+ overflow: hidden;
+}
+
+.side-by-side code {
+ border: none;
+ padding: 0;
+}
+
+.side-by-side .sample code {
+ margin: 0;
+}
+
+.side-by-side .sample {
+ border-right: 1px solid #ddd;
+ float: left;
+ padding: 0 24px 0 0;
+}
+
+.side-by-side .sample + .sample {
+ border-left: 1px solid #ddd;
+ border-right: none;
+ margin-left: -1px;
+ padding: 0 0 0 24px;
+}
+
+.side-by-side h4,
+.side-by-side pre,
+.section .side-by-side h4,
+.section .side-by-side pre {
+ margin-left: 0;
+}
+
+.highlight {
+ background: #ffc;
+}
+
+/* Masthead */
+#masthead p,
+h1 {
+ font-size: 1.5em;
+ margin: 0;
+}
+
+#masthead,
+h1 {
+ background: #333;
+
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#5f5f5f),
+ to(#222)
+ );
+
+ background: -moz-linear-gradient(
+ top center,
+ #5f5f5f,
+ #222
+ );
+
+ /* For Internet Explorer 5.5 - 7 */
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff5f5f5f, endColorstr=#ff222222);
+ /* For Internet Explorer 8 */
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#ff5f5f5f, endColorstr=#ff222222)";
+
+ border-bottom: 4px solid #c0c6cc;
+ box-shadow: 0 0 10px #ddd;
+ -moz-box-shadow: 0 0 10px #ddd;
+ -webkit-box-shadow: 0 0 10px #ddd;
+ color: #fff;
+ padding: 6px 12px;
+ margin: 0 -12px 1em;
+}
+
+#masthead a,
+h1 a {
+ color: #fff;
+ padding-right: 1em;
+ text-decoration: none;
+}
+
+h1 span,
+#masthead a span {
+ color: #a7a7a7;
+ padding-right: 1em;
+}
+
+.wrapper {
+ max-width: 1170px;
+}
+
+/* Main content */
+.content {
+ padding: 16px;
+ max-width: 800px;
+}
+
+* html .content {
+ width: 800px;
+}
+
+.content p {
+ margin: 0 0 1.5em;
+}
+
+.section div + h3,
+.section pre + h3,
+.section dl + h3,
+.section ol + h3,
+.section p + h3 {
+ margin-top: 2em;
+}
+
+.section pre,
+.section dl,
+.section p,
+.section h4,
+.section .side-by-side,
+.section table {
+ margin-left: 2em;
+}
+
+.section ol {
+ margin-left: 4em;
+}
+
+.intro pre,
+.intro dl,
+.intro ol,
+.intro p,
+.intro h4 {
+ margin-left: 0;
+}
+
+.msg p {
+ margin-bottom: .5em;
+}
+
+.msg dt {
+ width: 3em;
+}
+
+.msg dd {
+ float: none;
+}
+
+.properties dt,
+.properties dd {
+ float: none;
+ width: auto;
+}
+
+.properties dt {
+ border-bottom: 1px solid #eee;
+ display: inline-block;
+ margin: 0 0 0.25em;
+}
+
+.properties dd {
+ margin: 0 0 0.75em 2em;
+}
+
+p + .properties {
+ margin-top: -0.5em;
+}
+
+/* Aside */
+.aside {
+ padding: 2.7em 0 0 16px;
+}
+
+.aside h2 {
+ border: none;
+ font-family: "Droid Sans", Sans, Helvetica, Arial, sans-serif;
+ font-size: 1.2em;
+ font-weight: bold;
+ margin: 0 0 0.5em;
+}
+
+.aside ul {
+ margin-bottom: 2em;
+}
+
+.aside .nav ul {
+ margin: 0 0 0 15px;
+}
+
+@media all and (min-width: 1000px) {
+.aside {
+ background: #fff;
+ float: right;
+ width: 320px;
+}
+
+.aside h2 {
+ font-size: 1.5em;
+ font-weight: normal;
+ margin: 0;
+}
+
+.aside .nav {
+ border-top: 1px solid #c5c5c5;
+ margin: 0 0 2em;
+}
+
+.aside .nav ul {
+ border-top: none;
+ margin: 0;
+}
+
+.aside .nav li a,
+.aside .nav li a:visited {
+ background: #efefef;
+
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#efefef),
+ to(#f8f8f8)
+ );
+
+ background: -moz-linear-gradient(
+ top center,
+ #efefef,
+ #f8f8f8
+ );
+
+ color: #555;
+ border: 1px solid #c5c5c5;
+ border-top-color: #fff;
+ display: block;
+ padding: 2px 12px;
+ text-decoration: none;
+ text-shadow: 1px 1px 0 #fff;
+}
+
+.aside .nav li a:hover {
+ background: #fafafa;
+ color: #222;
+ text-decoration: underline;
+}
+
+.aside .nav .active > a,
+.aside .nav .active > a:visited,
+.aside .nav .active > a:hover {
+ background: #fff;
+ color: #000;
+ font-weight: bold;
+}
+
+.aside .nav ul .active > a,
+.aside .nav ul .active > a:visited,
+.aside .nav ul .active > a:hover {
+ background: #fafafa;
+}
+
+.aside .nav ul a {
+ padding-left: 36px;
+}
+
+.aside .nav code {
+ background: none;
+ padding: 0;
+}
+
+.aside .nav ul code {
+ font-size: 12px;
+}
+}
+
+/* Footer */
+.footer {
+ background: #222;
+
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ from(#222),
+ to(#000)
+ );
+
+ background: -moz-linear-gradient(
+ top center,
+ #222,
+ #000
+ );
+
+ border-top: 4px solid #c0c6cc;
+ clear: both;
+ color: #fff;
+ font-size: 0.8em;
+ font-family: Droid Sans, Sans, Helvetica, Arial, sans-serif;
+ padding: 12px;
+}
+
+.footer p {
+ max-width: 800px;
+}
+
+.footer a {
+ color: #fff;
}
Please sign in to comment.
Something went wrong with that request. Please try again.