jasnode 0.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.gitmodules +3 -0
- data/MIT.LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +34 -0
- data/VERSION.yml +5 -0
- data/bin/jasnode +52 -0
- data/features/jasnode.feature +24 -0
- data/features/step_definitions/jasnode-steps.rb +39 -0
- data/jasmine/MIT.LICENSE +20 -0
- data/jasmine/README.markdown +502 -0
- data/jasmine/Rakefile +158 -0
- data/jasmine/cruise_config.rb +21 -0
- data/jasmine/doc/files.html +460 -0
- data/jasmine/doc/index.html +322 -0
- data/jasmine/doc/symbols/_global_.html +918 -0
- data/jasmine/doc/symbols/jasmine.Block.html +417 -0
- data/jasmine/doc/symbols/jasmine.Clock.html +678 -0
- data/jasmine/doc/symbols/jasmine.Env.html +1169 -0
- data/jasmine/doc/symbols/jasmine.JsApiReporter.html +822 -0
- data/jasmine/doc/symbols/jasmine.Matchers.html +1474 -0
- data/jasmine/doc/symbols/jasmine.MultiReporter.html +394 -0
- data/jasmine/doc/symbols/jasmine.NestedResults.html +710 -0
- data/jasmine/doc/symbols/jasmine.Reporter.html +574 -0
- data/jasmine/doc/symbols/jasmine.Runner.html +710 -0
- data/jasmine/doc/symbols/jasmine.Spec.html +1253 -0
- data/jasmine/doc/symbols/jasmine.Spy.html +855 -0
- data/jasmine/doc/symbols/jasmine.Suite.html +705 -0
- data/jasmine/doc/symbols/jasmine.html +1345 -0
- data/jasmine/doc/symbols/jasmine.util.html +535 -0
- data/jasmine/doc/symbols/src/lib_TrivialReporter.js.html +124 -0
- data/jasmine/doc/symbols/src/src_Block.js.html +29 -0
- data/jasmine/doc/symbols/src/src_Env.js.html +248 -0
- data/jasmine/doc/symbols/src/src_JsApiReporter.js.html +111 -0
- data/jasmine/doc/symbols/src/src_Matchers.js.html +344 -0
- data/jasmine/doc/symbols/src/src_MultiReporter.js.html +36 -0
- data/jasmine/doc/symbols/src/src_NestedResults.js.html +88 -0
- data/jasmine/doc/symbols/src/src_PrettyPrinter.js.html +130 -0
- data/jasmine/doc/symbols/src/src_Queue.js.html +102 -0
- data/jasmine/doc/symbols/src/src_Reporter.js.html +35 -0
- data/jasmine/doc/symbols/src/src_Reporters.js.html +51 -0
- data/jasmine/doc/symbols/src/src_Runner.js.html +75 -0
- data/jasmine/doc/symbols/src/src_Spec.js.html +214 -0
- data/jasmine/doc/symbols/src/src_Suite.js.html +77 -0
- data/jasmine/doc/symbols/src/src_WaitsBlock.js.html +21 -0
- data/jasmine/doc/symbols/src/src_WaitsForBlock.js.html +45 -0
- data/jasmine/doc/symbols/src/src_base.js.html +585 -0
- data/jasmine/doc/symbols/src/src_mock-timeout.js.html +185 -0
- data/jasmine/doc/symbols/src/src_util.js.html +75 -0
- data/jasmine/examples/html/example_runner.html +27 -0
- data/jasmine/examples/html/spec/example_suite.js +11 -0
- data/jasmine/examples/ruby/Rakefile +33 -0
- data/jasmine/examples/ruby/spec/example/example_spec.js +11 -0
- data/jasmine/examples/ruby/spec/jasmine_helper.rb +41 -0
- data/jasmine/examples/ruby/spec/jasmine_spec.rb +31 -0
- data/jasmine/examples/ruby/spec/saucelabs.yml +24 -0
- data/jasmine/geminstaller.yml +25 -0
- data/jasmine/images/fail-16.png +0 -0
- data/jasmine/images/fail.png +0 -0
- data/jasmine/images/go-16.png +0 -0
- data/jasmine/images/go.png +0 -0
- data/jasmine/images/pending-16.png +0 -0
- data/jasmine/images/pending.png +0 -0
- data/jasmine/images/question-bk.png +0 -0
- data/jasmine/images/questionbk-16.png +0 -0
- data/jasmine/images/spinner.gif +0 -0
- data/jasmine/lib/TrivialReporter.js +117 -0
- data/jasmine/lib/consolex.js +28 -0
- data/jasmine/lib/jasmine-0.10.2.js +2318 -0
- data/jasmine/lib/jasmine.css +86 -0
- data/jasmine/lib/json2.js +478 -0
- data/jasmine/spec/jasmine_helper.rb +44 -0
- data/jasmine/spec/jasmine_spec.rb +31 -0
- data/jasmine/spec/runner.html +79 -0
- data/jasmine/spec/saucelabs.yml +24 -0
- data/jasmine/spec/suites/CustomMatchersSpec.js +112 -0
- data/jasmine/spec/suites/EnvSpec.js +141 -0
- data/jasmine/spec/suites/ExceptionsSpec.js +107 -0
- data/jasmine/spec/suites/JsApiReporterSpec.js +82 -0
- data/jasmine/spec/suites/MatchersSpec.js +709 -0
- data/jasmine/spec/suites/MockClockSpec.js +34 -0
- data/jasmine/spec/suites/MultiReporterSpec.js +30 -0
- data/jasmine/spec/suites/NestedResultsSpec.js +54 -0
- data/jasmine/spec/suites/PrettyPrintSpec.js +93 -0
- data/jasmine/spec/suites/QueueSpec.js +23 -0
- data/jasmine/spec/suites/ReporterSpec.js +60 -0
- data/jasmine/spec/suites/RunnerSpec.js +252 -0
- data/jasmine/spec/suites/SpecRunningSpec.js +1086 -0
- data/jasmine/spec/suites/SpecSpec.js +110 -0
- data/jasmine/spec/suites/SpySpec.js +201 -0
- data/jasmine/spec/suites/SuiteSpec.js +101 -0
- data/jasmine/spec/suites/TrivialReporterSpec.js +140 -0
- data/jasmine/spec/suites/UtilSpec.js +40 -0
- data/jasmine/src/Block.js +22 -0
- data/jasmine/src/Env.js +240 -0
- data/jasmine/src/JsApiReporter.js +103 -0
- data/jasmine/src/Matchers.js +336 -0
- data/jasmine/src/MultiReporter.js +28 -0
- data/jasmine/src/NestedResults.js +80 -0
- data/jasmine/src/PrettyPrinter.js +122 -0
- data/jasmine/src/Queue.js +94 -0
- data/jasmine/src/Reporter.js +27 -0
- data/jasmine/src/Reporters.js +43 -0
- data/jasmine/src/Runner.js +68 -0
- data/jasmine/src/Spec.js +206 -0
- data/jasmine/src/Suite.js +70 -0
- data/jasmine/src/WaitsBlock.js +13 -0
- data/jasmine/src/WaitsForBlock.js +38 -0
- data/jasmine/src/base.js +578 -0
- data/jasmine/src/mock-timeout.js +177 -0
- data/jasmine/src/util.js +67 -0
- data/jasmine/src/version.json +5 -0
- data/jasnode.gemspec +171 -0
- data/lib/jasnode/core.rb +180 -0
- data/lib/jasnode.js +135 -0
- data/lib/jasnode.rb +4 -0
- data/pkg/jasnode-0.1.0.0.gem +0 -0
- data/spec/jasnode/jasnode_spec.rb +40 -0
- data/spec/rspec_suite.rb +8 -0
- data/spec/spec_helper.rb +6 -0
- data/templates/Rakefile +9 -0
- data/templates/bin/hello_world +5 -0
- data/templates/lib/server.js +25 -0
- data/templates/spec/README.md +3 -0
- data/templates/spec/runner.js +16 -0
- data/templates/spec/server/server_spec.js +45 -0
- data/templates/spec/server/spec_server.js +45 -0
- data/templates/spec/spec.js +45 -0
- metadata +184 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.DS_Store
|
data/.gitmodules
ADDED
data/MIT.LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Cory Ondrejka
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Jasnode
|
2
|
+
|
3
|
+
Inspired by [node-jasmine](http://github.com/mhevery/jasmine-node), Angrybits Jasmine is a simple way to use Pivotal's [jasmine](http://github.com/pivotal/jasmine) with [Node.js](http://github.com/ry/node).
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
## License
|
8
|
+
|
9
|
+
Copyright (c) 2010 Cory Ondrejka
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
12
|
+
a copy of this software and associated documentation files (the
|
13
|
+
"Software"), to deal in the Software without restriction, including
|
14
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
15
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
16
|
+
permit persons to whom the Software is furnished to do so, subject to
|
17
|
+
the following conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be
|
20
|
+
included in all copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
23
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
24
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
25
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
26
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
27
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
28
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
unless File.exists?('jasmine/lib')
|
5
|
+
raise "Jasmine submodule isn't present. Run git submodule update --init"
|
6
|
+
end
|
7
|
+
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
|
10
|
+
Spec::Rake::SpecTask.new('examples') do |t|
|
11
|
+
t.spec_files = FileList['spec/rspec_suite.rb']
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'cucumber'
|
15
|
+
require 'cucumber/rake/task'
|
16
|
+
|
17
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
18
|
+
t.cucumber_opts = "features --format pretty"
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
require 'jeweler'
|
23
|
+
Jeweler::Tasks.new do |gemspec|
|
24
|
+
gemspec.name = "jasnode"
|
25
|
+
gemspec.summary = "Jasmine Ruby Runner"
|
26
|
+
gemspec.description = "Easy Jasmine BDD with Node.js"
|
27
|
+
gemspec.email = "cory.ondrejka+jasnode@gmail.com"
|
28
|
+
gemspec.homepage = "http://angrybits.github.com/jasnode"
|
29
|
+
gemspec.authors = ["Cory Ondrejka"]
|
30
|
+
gemspec.executables = ["jasnode"]
|
31
|
+
gemspec.files.include %w( jasmine/**/* )
|
32
|
+
end
|
33
|
+
|
34
|
+
Jeweler::GemcutterTasks.new
|
data/VERSION.yml
ADDED
data/bin/jasnode
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Copyright (c) 2010 Cory Ondrejka. All rights reserved.
|
4
|
+
# See MIT.LICENSE for licensing details.
|
5
|
+
|
6
|
+
jasnode_base = File.expand_path File.join(File.dirname(__FILE__), '..', 'lib')
|
7
|
+
$LOAD_PATH.unshift(jasnode_base) unless $LOAD_PATH.include?(jasnode_base)
|
8
|
+
|
9
|
+
require 'rubygems'
|
10
|
+
require 'commander/import'
|
11
|
+
require 'jasnode'
|
12
|
+
|
13
|
+
def get_version
|
14
|
+
require "yaml"
|
15
|
+
v = YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__), "..", "VERSION.yml")))
|
16
|
+
"#{v[:major]}.#{v[:minor]}.#{v[:build]}.#{v[:patch]}"
|
17
|
+
end
|
18
|
+
|
19
|
+
program :name, 'jasnode'
|
20
|
+
program :version, get_version
|
21
|
+
program :description, 'Easy Jasmine BDD with Node.js'
|
22
|
+
program :formatter, :compact
|
23
|
+
|
24
|
+
default_command :spec
|
25
|
+
|
26
|
+
command :spec do |c|
|
27
|
+
c.syntax = 'jasnode spec [options]'
|
28
|
+
c.description = 'Runs spec using jasmine and node.js'
|
29
|
+
c.option "--verbose", "Run verbosely"
|
30
|
+
c.option "--log", "Log output to [logfile] if defined, otherwise to logfile.txt"
|
31
|
+
c.option "--logfile FILE", "Destination for logging, implies --log"
|
32
|
+
|
33
|
+
c.action do |args, options|
|
34
|
+
if options.logfile
|
35
|
+
options.log = true
|
36
|
+
end
|
37
|
+
options.default :logfile => "logfile.txt"
|
38
|
+
puts Jasnode::Spec.spec(options.verbose, options.log ? options.logfile : nil)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
command :init do |c|
|
43
|
+
c.syntax = 'jasnode init <project>'
|
44
|
+
c.description = 'Initiazlie a project directory for node.js that jasnode can test'
|
45
|
+
c.example 'Create a new project directory ready for jasmine testing called "myproject"', 'jasnode init myproject'
|
46
|
+
c.action do |args, options|
|
47
|
+
projectname = args.shift or raise 'Project name required'
|
48
|
+
Jasnode::Init.template(projectname)
|
49
|
+
say "Project template initialized at `#{projectname}'"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Copyright (c) 2010 Cory Ondrejka. All rights reserved.
|
2
|
+
# See MIT.LICENSE for licensing details.
|
3
|
+
|
4
|
+
Feature: Running jasmine with node.js
|
5
|
+
In order to be able to test node.js server programs
|
6
|
+
As a developer
|
7
|
+
I want a simple way to create and run jasmine tests with node.js
|
8
|
+
|
9
|
+
Scenario: correctly initialize directories
|
10
|
+
Given I am ready to work
|
11
|
+
When I give the jasnode command init "newproject"
|
12
|
+
Then I should have a properly populated "newproject" directory
|
13
|
+
|
14
|
+
Scenario: run javascript specs
|
15
|
+
Given a jasnode directory
|
16
|
+
When I give the jasnode command spec
|
17
|
+
Then I should see test results
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright (c) 2010 Cory Ondrejka. All rights reserved.
|
2
|
+
# See MIT.LICENSE for licensing details.
|
3
|
+
JASNODE_BIN = File.join(File.dirname(__FILE__), '..', '..', 'bin')
|
4
|
+
|
5
|
+
Given /^I am ready to work$/ do
|
6
|
+
end
|
7
|
+
|
8
|
+
When /^I give the jasnode command init "([^\"]*)"$/ do |projectname|
|
9
|
+
@name = projectname
|
10
|
+
%x[#{JASNODE_BIN}/jasnode init #{@name}].should == "Project template initialized at `#{@name}'\n"
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^I should have a properly populated "([^\"]*)" directory$/ do |arg1|
|
14
|
+
require "ftools"
|
15
|
+
File.exist?("#{@name}").should == true
|
16
|
+
File.exist?("#{@name}/lib").should == true
|
17
|
+
File.exist?("#{@name}/spec").should == true
|
18
|
+
File.exist?("#{@name}/bin").should == true
|
19
|
+
File.exist?("#{@name}/Rakefile").should == true
|
20
|
+
FileUtils.rm_rf("#{@name}")
|
21
|
+
File.exist?("#{@name}").should == false
|
22
|
+
end
|
23
|
+
|
24
|
+
Given /^a jasnode directory$/ do
|
25
|
+
@name = "spectest"
|
26
|
+
%x[#{JASNODE_BIN}/jasnode init #{@name}].should == "Project template initialized at `#{@name}'\n"
|
27
|
+
end
|
28
|
+
|
29
|
+
When /^I give the jasnode command spec$/ do
|
30
|
+
Dir.chdir(@name)
|
31
|
+
@output = %x[../#{JASNODE_BIN}/jasnode spec]
|
32
|
+
end
|
33
|
+
|
34
|
+
Then /^I should see test results$/ do
|
35
|
+
@output = @output.split("\n")
|
36
|
+
@output[-1].should == "\e[1m12 examples\e[22m, \e[32m0 failures\e[39m"
|
37
|
+
Dir.chdir("..")
|
38
|
+
FileUtils.rm_rf("#{@name}")
|
39
|
+
end
|
data/jasmine/MIT.LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Pivotal Labs
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|