From 9a28618880fcb90a85345f820508f9c6ff4faf23 Mon Sep 17 00:00:00 2001 From: Larry Karnowski Date: Fri, 23 Jan 2009 18:32:46 -0500 Subject: [PATCH] cleaning up fixture/spec generation --- TODO.taskpaper | 3 +- .../javascript_testing_generator.rb | 2 +- .../javascript_testing/templates/js-spec.css | 28 ------ .../javascript_testing/templates/screw.css | 90 +++++++++++++++++++ tasks/javascript_testing_tasks.rake | 2 +- 5 files changed, 94 insertions(+), 31 deletions(-) delete mode 100644 generators/javascript_testing/templates/js-spec.css create mode 100644 generators/javascript_testing/templates/screw.css diff --git a/TODO.taskpaper b/TODO.taskpaper index c0fc760..c971446 100644 --- a/TODO.taskpaper +++ b/TODO.taskpaper @@ -9,7 +9,8 @@ Release 1: - change generators to use Screw.Unit style instead of JS-Spec - improve "require" to take an array and chain then together in order @release2? - test that env-js works with DOCTYPEs now? - +- why is rake building everything twice (from command line & from TextMate) Release 2: - write Java code (and include jar) that allows calling print without adding an additional newline - will require an ant build in the plugin? +- rake task to open fixtures in your favorite web browser? diff --git a/generators/javascript_testing/javascript_testing_generator.rb b/generators/javascript_testing/javascript_testing_generator.rb index f21ba03..f8f5bd9 100644 --- a/generators/javascript_testing/javascript_testing_generator.rb +++ b/generators/javascript_testing/javascript_testing_generator.rb @@ -7,7 +7,7 @@ def manifest m.directory 'test/javascript/fixtures' m.file 'application.html', 'test/javascript/fixtures/application.html' - m.file 'js-spec.css', 'test/javascript/fixtures/js-spec.css' + m.file 'screw.css', 'test/javascript/fixtures/screw.css' end end end diff --git a/generators/javascript_testing/templates/js-spec.css b/generators/javascript_testing/templates/js-spec.css deleted file mode 100644 index 707b4c1..0000000 --- a/generators/javascript_testing/templates/js-spec.css +++ /dev/null @@ -1,28 +0,0 @@ -th, td { - text-align: left; - padding: 0 .2em; -} - -tr.pending { - background: #ee9; -} - -tr.pass { - background: #9e9; -} - -tr.fail { - background: #e99; -} - -tr.error { - background: #111; - color: #fff; -} - -.label { - text-transform: uppercase; - font-weight: bold; - padding: 0 .2em; -} - diff --git a/generators/javascript_testing/templates/screw.css b/generators/javascript_testing/templates/screw.css new file mode 100644 index 0000000..8ffb368 --- /dev/null +++ b/generators/javascript_testing/templates/screw.css @@ -0,0 +1,90 @@ +html { + padding: 0.5em; + font-family: Georgia, serif; + background: #EDEBD5; +} + + li { + list-style-type: none; + } + + .focused { + background-color: #F4F2E4; + } + + .focused * { + opacity: 1.0; + } + + h1, h2, p { + opacity: 0.4; + } + + .describes { + padding-left: 0; + } + + .describes h1 { + font-size: 1.1em; + color: #877C21; + line-height: 1.8em; + margin: 0pt 0pt 0.6em; + border-bottom: 1px solid transparent; + } + + .describes h1:hover { + cursor: pointer; + color: #000; + background-color: #F4F2E4; + border-bottom: 1px solid #9A8E51; + } + + .describes .describe { + margin-left: 0.6em; + padding-left: 0.6em; + border: 1px dashed #999; + } + + .describes .describe .its {} + + .describes .describe .its .it { + list-style-type: lower-roman; + list-style-position: outside; + } + + .describes .describe .its .it h2 { + font-weight: normal; + font-style: italic; + padding-left: 0.5em; + font-size: 1.0em; + color: #877C21; + line-height: 1.8em; + margin: 0 0 0.5em; + border-bottom: 1px solid transparent; + } + + .describes .describe .its .it.enqueued h2 { + background-color: #CC6600; + color: white !important; + } + + .describes .describe .its .it.passed h2 { + background-color: #5A753D; + color: white !important; + } + + .describes .describe .its .it.failed h2 { + background-color: #993300; + color: white !important; + } + + .describes .describe .its .it.failed p { + margin-left: 1em; + color: #993300; + } + + .describes .describe .its .it h2:hover { + cursor: pointer; + color: #000 !important; + border-bottom: 1px solid #9A8E51; + } diff --git a/tasks/javascript_testing_tasks.rake b/tasks/javascript_testing_tasks.rake index 7a4bf90..95335e1 100644 --- a/tasks/javascript_testing_tasks.rake +++ b/tasks/javascript_testing_tasks.rake @@ -1,7 +1,7 @@ namespace :test do desc "Runs all the JSSpec tests and collects the results" task :javascripts do - plugin_prefix = "#{RAILS_ROOT}/vendor/plugins/javascript_testing" + plugin_prefix = "#{RAILS_ROOT}/vendor/plugins/javascript_testing" test_runner_command = "java -jar #{plugin_prefix}/lib/js.jar #{plugin_prefix}/lib/test_runner.js" Dir.chdir("test/javascript") do