jasnode 0.2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/.gitignore +1 -0
  2. data/.gitmodules +3 -0
  3. data/MIT.LICENSE +20 -0
  4. data/README.md +28 -0
  5. data/Rakefile +34 -0
  6. data/VERSION.yml +5 -0
  7. data/bin/jasnode +52 -0
  8. data/features/jasnode.feature +24 -0
  9. data/features/step_definitions/jasnode-steps.rb +39 -0
  10. data/jasmine/MIT.LICENSE +20 -0
  11. data/jasmine/README.markdown +502 -0
  12. data/jasmine/Rakefile +158 -0
  13. data/jasmine/cruise_config.rb +21 -0
  14. data/jasmine/doc/files.html +460 -0
  15. data/jasmine/doc/index.html +322 -0
  16. data/jasmine/doc/symbols/_global_.html +918 -0
  17. data/jasmine/doc/symbols/jasmine.Block.html +417 -0
  18. data/jasmine/doc/symbols/jasmine.Clock.html +678 -0
  19. data/jasmine/doc/symbols/jasmine.Env.html +1169 -0
  20. data/jasmine/doc/symbols/jasmine.JsApiReporter.html +822 -0
  21. data/jasmine/doc/symbols/jasmine.Matchers.html +1474 -0
  22. data/jasmine/doc/symbols/jasmine.MultiReporter.html +394 -0
  23. data/jasmine/doc/symbols/jasmine.NestedResults.html +710 -0
  24. data/jasmine/doc/symbols/jasmine.Reporter.html +574 -0
  25. data/jasmine/doc/symbols/jasmine.Runner.html +710 -0
  26. data/jasmine/doc/symbols/jasmine.Spec.html +1253 -0
  27. data/jasmine/doc/symbols/jasmine.Spy.html +855 -0
  28. data/jasmine/doc/symbols/jasmine.Suite.html +705 -0
  29. data/jasmine/doc/symbols/jasmine.html +1345 -0
  30. data/jasmine/doc/symbols/jasmine.util.html +535 -0
  31. data/jasmine/doc/symbols/src/lib_TrivialReporter.js.html +124 -0
  32. data/jasmine/doc/symbols/src/src_Block.js.html +29 -0
  33. data/jasmine/doc/symbols/src/src_Env.js.html +248 -0
  34. data/jasmine/doc/symbols/src/src_JsApiReporter.js.html +111 -0
  35. data/jasmine/doc/symbols/src/src_Matchers.js.html +344 -0
  36. data/jasmine/doc/symbols/src/src_MultiReporter.js.html +36 -0
  37. data/jasmine/doc/symbols/src/src_NestedResults.js.html +88 -0
  38. data/jasmine/doc/symbols/src/src_PrettyPrinter.js.html +130 -0
  39. data/jasmine/doc/symbols/src/src_Queue.js.html +102 -0
  40. data/jasmine/doc/symbols/src/src_Reporter.js.html +35 -0
  41. data/jasmine/doc/symbols/src/src_Reporters.js.html +51 -0
  42. data/jasmine/doc/symbols/src/src_Runner.js.html +75 -0
  43. data/jasmine/doc/symbols/src/src_Spec.js.html +214 -0
  44. data/jasmine/doc/symbols/src/src_Suite.js.html +77 -0
  45. data/jasmine/doc/symbols/src/src_WaitsBlock.js.html +21 -0
  46. data/jasmine/doc/symbols/src/src_WaitsForBlock.js.html +45 -0
  47. data/jasmine/doc/symbols/src/src_base.js.html +585 -0
  48. data/jasmine/doc/symbols/src/src_mock-timeout.js.html +185 -0
  49. data/jasmine/doc/symbols/src/src_util.js.html +75 -0
  50. data/jasmine/examples/html/example_runner.html +27 -0
  51. data/jasmine/examples/html/spec/example_suite.js +11 -0
  52. data/jasmine/examples/ruby/Rakefile +33 -0
  53. data/jasmine/examples/ruby/spec/example/example_spec.js +11 -0
  54. data/jasmine/examples/ruby/spec/jasmine_helper.rb +41 -0
  55. data/jasmine/examples/ruby/spec/jasmine_spec.rb +31 -0
  56. data/jasmine/examples/ruby/spec/saucelabs.yml +24 -0
  57. data/jasmine/geminstaller.yml +25 -0
  58. data/jasmine/images/fail-16.png +0 -0
  59. data/jasmine/images/fail.png +0 -0
  60. data/jasmine/images/go-16.png +0 -0
  61. data/jasmine/images/go.png +0 -0
  62. data/jasmine/images/pending-16.png +0 -0
  63. data/jasmine/images/pending.png +0 -0
  64. data/jasmine/images/question-bk.png +0 -0
  65. data/jasmine/images/questionbk-16.png +0 -0
  66. data/jasmine/images/spinner.gif +0 -0
  67. data/jasmine/lib/TrivialReporter.js +117 -0
  68. data/jasmine/lib/consolex.js +28 -0
  69. data/jasmine/lib/jasmine-0.10.2.js +2318 -0
  70. data/jasmine/lib/jasmine.css +86 -0
  71. data/jasmine/lib/json2.js +478 -0
  72. data/jasmine/spec/jasmine_helper.rb +44 -0
  73. data/jasmine/spec/jasmine_spec.rb +31 -0
  74. data/jasmine/spec/runner.html +79 -0
  75. data/jasmine/spec/saucelabs.yml +24 -0
  76. data/jasmine/spec/suites/CustomMatchersSpec.js +112 -0
  77. data/jasmine/spec/suites/EnvSpec.js +141 -0
  78. data/jasmine/spec/suites/ExceptionsSpec.js +107 -0
  79. data/jasmine/spec/suites/JsApiReporterSpec.js +82 -0
  80. data/jasmine/spec/suites/MatchersSpec.js +709 -0
  81. data/jasmine/spec/suites/MockClockSpec.js +34 -0
  82. data/jasmine/spec/suites/MultiReporterSpec.js +30 -0
  83. data/jasmine/spec/suites/NestedResultsSpec.js +54 -0
  84. data/jasmine/spec/suites/PrettyPrintSpec.js +93 -0
  85. data/jasmine/spec/suites/QueueSpec.js +23 -0
  86. data/jasmine/spec/suites/ReporterSpec.js +60 -0
  87. data/jasmine/spec/suites/RunnerSpec.js +252 -0
  88. data/jasmine/spec/suites/SpecRunningSpec.js +1086 -0
  89. data/jasmine/spec/suites/SpecSpec.js +110 -0
  90. data/jasmine/spec/suites/SpySpec.js +201 -0
  91. data/jasmine/spec/suites/SuiteSpec.js +101 -0
  92. data/jasmine/spec/suites/TrivialReporterSpec.js +140 -0
  93. data/jasmine/spec/suites/UtilSpec.js +40 -0
  94. data/jasmine/src/Block.js +22 -0
  95. data/jasmine/src/Env.js +240 -0
  96. data/jasmine/src/JsApiReporter.js +103 -0
  97. data/jasmine/src/Matchers.js +336 -0
  98. data/jasmine/src/MultiReporter.js +28 -0
  99. data/jasmine/src/NestedResults.js +80 -0
  100. data/jasmine/src/PrettyPrinter.js +122 -0
  101. data/jasmine/src/Queue.js +94 -0
  102. data/jasmine/src/Reporter.js +27 -0
  103. data/jasmine/src/Reporters.js +43 -0
  104. data/jasmine/src/Runner.js +68 -0
  105. data/jasmine/src/Spec.js +206 -0
  106. data/jasmine/src/Suite.js +70 -0
  107. data/jasmine/src/WaitsBlock.js +13 -0
  108. data/jasmine/src/WaitsForBlock.js +38 -0
  109. data/jasmine/src/base.js +578 -0
  110. data/jasmine/src/mock-timeout.js +177 -0
  111. data/jasmine/src/util.js +67 -0
  112. data/jasmine/src/version.json +5 -0
  113. data/jasnode.gemspec +171 -0
  114. data/lib/jasnode/core.rb +180 -0
  115. data/lib/jasnode.js +135 -0
  116. data/lib/jasnode.rb +4 -0
  117. data/pkg/jasnode-0.1.0.0.gem +0 -0
  118. data/spec/jasnode/jasnode_spec.rb +40 -0
  119. data/spec/rspec_suite.rb +8 -0
  120. data/spec/spec_helper.rb +6 -0
  121. data/templates/Rakefile +9 -0
  122. data/templates/bin/hello_world +5 -0
  123. data/templates/lib/server.js +25 -0
  124. data/templates/spec/README.md +3 -0
  125. data/templates/spec/runner.js +16 -0
  126. data/templates/spec/server/server_spec.js +45 -0
  127. data/templates/spec/server/spec_server.js +45 -0
  128. data/templates/spec/spec.js +45 -0
  129. metadata +184 -0
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ .DS_Store
data/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "jasmine"]
2
+ path = jasmine
3
+ url = git://github.com/pivotal/jasmine.git
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
@@ -0,0 +1,5 @@
1
+ ---
2
+ :patch: 0
3
+ :major: 0
4
+ :build: 0
5
+ :minor: 2
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
@@ -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.