jasmine 2.0.0 → 2.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +27 -13
  3. data/Gemfile +9 -9
  4. data/HOW_TO_TEST.markdown +1 -0
  5. data/README.markdown +18 -11
  6. data/jasmine.gemspec +14 -6
  7. data/lib/generators/jasmine/examples/templates/spec/javascripts/helpers/jasmine_examples/SpecHelper.js +1 -1
  8. data/lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine.yml +38 -5
  9. data/lib/generators/jasmine/install/templates/spec/javascripts/support/jasmine_helper.rb +14 -9
  10. data/lib/jasmine/application.rb +2 -2
  11. data/lib/jasmine/asset_expander.rb +56 -8
  12. data/lib/jasmine/base.rb +5 -5
  13. data/lib/jasmine/ci_runner.rb +50 -0
  14. data/lib/jasmine/command_line_tool.rb +4 -4
  15. data/lib/jasmine/config.rb +34 -5
  16. data/lib/jasmine/configuration.rb +31 -11
  17. data/lib/jasmine/dependencies.rb +8 -37
  18. data/lib/jasmine/formatters/console.rb +69 -4
  19. data/lib/jasmine/formatters/exit_code.rb +4 -6
  20. data/lib/jasmine/formatters/multi.rb +3 -11
  21. data/lib/jasmine/path_expander.rb +5 -1
  22. data/lib/jasmine/path_mapper.rb +11 -2
  23. data/lib/jasmine/railtie.rb +1 -1
  24. data/lib/jasmine/result.rb +21 -9
  25. data/lib/jasmine/ruby_versions.rb +11 -0
  26. data/lib/jasmine/run.html.erb +1 -1
  27. data/lib/jasmine/runners/phantom_boot.js +15 -0
  28. data/lib/jasmine/runners/phantom_jasmine_run.js +39 -43
  29. data/lib/jasmine/runners/phantom_js.rb +53 -8
  30. data/lib/jasmine/server.rb +7 -10
  31. data/lib/jasmine/tasks/jasmine.rake +29 -25
  32. data/lib/jasmine/version.rb +1 -1
  33. data/lib/jasmine/yaml_config_parser.rb +28 -0
  34. data/lib/jasmine.rb +1 -1
  35. data/release_notes/v2.0.1.md +31 -0
  36. data/release_notes/v2.0.2.md +17 -0
  37. data/release_notes/v2.0.3.md +31 -0
  38. data/release_notes/v2.1.0.md +11 -0
  39. data/release_notes/v2.2.0.md +31 -0
  40. data/release_notes/v2.3.0.md +27 -0
  41. data/release_notes/v2.3.1.md +14 -0
  42. data/release_notes/v2.4.0.md +20 -0
  43. data/release_notes/v2.5.0.md +35 -0
  44. data/release_notes/v2.5.1.md +12 -0
  45. data/release_notes/v2.5.2.md +22 -0
  46. data/release_notes/v2.6.0.md +17 -0
  47. data/release_notes/v2.6.1.md +11 -0
  48. data/release_notes/v2.7.0.md +28 -0
  49. data/release_notes/v2.8.0.md +21 -0
  50. data/release_notes/v2.9.0.md +22 -0
  51. data/release_notes/v2.99.md +13 -0
  52. data/spec/application_integration_spec.rb +3 -3
  53. data/spec/application_spec.rb +27 -11
  54. data/spec/base_spec.rb +27 -6
  55. data/spec/ci_runner_spec.rb +137 -0
  56. data/spec/configuration_spec.rb +57 -23
  57. data/spec/fixture/afterall_spec.js +8 -0
  58. data/spec/fixture/console_log_spec.js +5 -0
  59. data/spec/fixture/exception_test.js +1 -0
  60. data/spec/fixture/phantomConfig.js +6 -0
  61. data/spec/fixture/viewport_spec.js +6 -0
  62. data/spec/jasmine_command_line_tool_spec.rb +46 -27
  63. data/spec/jasmine_pojs_spec.rb +73 -12
  64. data/spec/jasmine_rails_spec.rb +107 -41
  65. data/spec/lib/jasmine/formatters/console_spec.rb +124 -26
  66. data/spec/lib/jasmine/formatters/exit_code_spec.rb +34 -0
  67. data/spec/lib/jasmine/formatters/multi_spec.rb +16 -6
  68. data/spec/page_spec.rb +2 -2
  69. data/spec/path_expander_spec.rb +22 -5
  70. data/spec/path_mapper_spec.rb +14 -9
  71. data/spec/performance/phantom_js_runner_performance_spec.rb +1 -1
  72. data/spec/phantom_js_spec.rb +14 -0
  73. data/spec/rack/jasmine/runner_spec.rb +2 -2
  74. data/spec/result_spec.rb +17 -7
  75. data/spec/server_spec.rb +13 -39
  76. data/spec/spec_helper.rb +54 -6
  77. data/spec/yaml_config_parser_spec.rb +21 -21
  78. metadata +75 -36
  79. data/lib/jasmine/asset_bundle.rb +0 -68
@@ -1,3 +1,19 @@
1
+ if Rake.application.tasks.any? {|t| t.name == 'jasmine/ci' }
2
+ message = <<-EOF
3
+
4
+ WARNING
5
+ Detected that jasmine rake tasks have been loaded twice.
6
+ This will cause the 'rake jasmine:ci' and 'rake jasmine' tasks to fail.
7
+
8
+ To fix this problem, you should ensure that you only load 'jasmine/tasks/jasmine.rake'
9
+ once. This should be done for you automatically if you installed jasmine's rake tasks
10
+ with either 'jasmine init' or 'rails g jasmine:install'.
11
+
12
+
13
+ EOF
14
+ raise Exception.new(message)
15
+ end
16
+
1
17
  namespace :jasmine do
2
18
  task :configure do
3
19
  require 'jasmine/config'
@@ -23,38 +39,26 @@ namespace :jasmine do
23
39
  end
24
40
  end
25
41
 
26
- desc 'Run continuous integration tests'
27
- task :ci => %w(jasmine:require_json jasmine:require jasmine:configure) do
28
- config = Jasmine.config
42
+ task :configure_plugins
29
43
 
30
- server = Jasmine::Server.new(config.port(:ci), Jasmine::Application.app(config))
31
- t = Thread.new do
32
- begin
33
- server.start
34
- rescue ChildProcess::TimeoutError
44
+ desc 'Run jasmine tests in a browser, random and seed override config'
45
+ task :ci, [:random, :seed] => %w(jasmine:require_json jasmine:require jasmine:configure jasmine:configure_plugins) do |t, args|
46
+ if ENV['spec']
47
+ spec_path = ENV['spec'].dup
48
+ if spec_path.include? "spec/javascripts/" # crappy hack to allow for bash tab completion
49
+ spec_path = spec_path.split("spec/javascripts/").last
35
50
  end
36
- # # ignore bad exits
51
+ Jasmine.load_spec(spec_path)
37
52
  end
38
- t.abort_on_exception = true
39
- Jasmine::wait_for_listener(config.port(:ci), 'jasmine server')
40
- puts 'jasmine server started.'
41
-
42
- formatters = config.formatters.map { |formatter_class| formatter_class.new }
43
-
44
- exit_code_formatter = Jasmine::Formatters::ExitCode.new
45
- formatters << exit_code_formatter
46
-
47
- url = "#{config.host}:#{config.port(:ci)}/"
48
- runner = config.runner.call(Jasmine::Formatters::Multi.new(formatters), url)
49
- runner.run
50
53
 
51
- break unless exit_code_formatter.succeeded?
54
+ ci_runner = Jasmine::CiRunner.new(Jasmine.config, args.to_hash)
55
+ exit(1) unless ci_runner.run
52
56
  end
53
57
 
54
- task :server => %w(jasmine:require jasmine:configure) do
58
+ task :server => %w(jasmine:require jasmine:configure jasmine:configure_plugins) do
55
59
  config = Jasmine.config
56
60
  port = config.port(:server)
57
- server = Jasmine::Server.new(port, Jasmine::Application.app(Jasmine.config))
61
+ server = Jasmine::Server.new(port, Jasmine::Application.app(Jasmine.config), config.rack_options)
58
62
  puts "your server is running here: http://localhost:#{port}/"
59
63
  puts "your tests are here: #{config.spec_dir}"
60
64
  puts "your source files are here: #{config.src_dir}"
@@ -63,5 +67,5 @@ namespace :jasmine do
63
67
  end
64
68
  end
65
69
 
66
- desc 'Run specs via server:ci'
70
+ desc 'Start server to host jasmine specs'
67
71
  task :jasmine => %w(jasmine:server)
@@ -1,3 +1,3 @@
1
1
  module Jasmine
2
- VERSION = "2.0.0"
2
+ VERSION = "2.99.0"
3
3
  end
@@ -59,6 +59,34 @@ module Jasmine
59
59
  File.join(@pwd, loaded_yaml['spec_helper'] || File.join('spec', 'javascripts', 'support', 'jasmine_helper.rb'))
60
60
  end
61
61
 
62
+ def show_console_log
63
+ loaded_yaml['show_console_log'] || false
64
+ end
65
+
66
+ def stop_spec_on_expectation_failure
67
+ loaded_yaml['stop_spec_on_expectation_failure'] || false
68
+ end
69
+
70
+ def random
71
+ loaded_yaml['random'] || false
72
+ end
73
+
74
+ def phantom_config_script
75
+ return nil unless loaded_yaml['phantom_config_script']
76
+ File.join @pwd, loaded_yaml['phantom_config_script']
77
+ end
78
+
79
+ def phantom_cli_options
80
+ loaded_yaml['phantom_cli_options'] || {}
81
+ end
82
+
83
+ def rack_options
84
+ loaded_yaml.fetch('rack_options', {}).inject({}) do |memo, (key, value)|
85
+ memo[key.to_sym] = value
86
+ memo
87
+ end
88
+ end
89
+
62
90
  private
63
91
  def loaded_yaml
64
92
  @yaml_loader.call(@path)
data/lib/jasmine.rb CHANGED
@@ -8,12 +8,12 @@ jasmine_files = ['base',
8
8
  'command_line_tool',
9
9
  'page',
10
10
  'path_mapper',
11
- 'asset_bundle',
12
11
  'asset_pipeline_mapper',
13
12
  'asset_expander',
14
13
  'result',
15
14
  'path_expander',
16
15
  'yaml_config_parser',
16
+ 'ci_runner',
17
17
  File.join('formatters', 'exit_code'),
18
18
  File.join('formatters', 'console'),
19
19
  File.join('formatters', 'multi'),
@@ -0,0 +1,31 @@
1
+ # Jasmine Gem 2.0.1 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This is a minor release with some updates to allow more configuration and support for Rails 4.1
6
+
7
+ ## Changes
8
+
9
+ * No longer try to save `jasmine:ci` from bad server exits
10
+ * Print help when no argument is passed to command line tool
11
+ * Add a hook for plugins to configure themselves after jasmine has loaded the default configuration.
12
+ * default stylesheets for rails use assets/application.css
13
+ * Allow rack apps to have configuration other than blocks
14
+ * support http sources for pulling js/css from a CDN
15
+ * Allow custom rack options to be passed when starting jasmine server
16
+
17
+ ## Fixes
18
+
19
+ * Allow all versions of rails 4
20
+ * don't use thin in jruby
21
+
22
+ ## Accepted Pull Requests
23
+
24
+ * Fix the method that checks whether jasmine server is running #[196](http://github.com/pivotal/jasmine-gem/pull/196)
25
+ * streaming ouput for phantom runner in jasmine:ci #[190](http://github.com/pivotal/jasmine-gem/pull/190)
26
+ * Fix rails generator help message. #[189](http://github.com/pivotal/jasmine-gem/pull/189)
27
+ * Update railtie to support Rails 4.1 #[186](http://github.com/pivotal/jasmine-gem/pull/186)
28
+
29
+ ------
30
+
31
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,17 @@
1
+ # Jasmine Gem 2.0.2 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This is a minor release primarily allowing the phantom js download to be skipped
6
+
7
+ ## Accepted Pull Requests
8
+
9
+ * Allow prevention of PhantomJS download #[213](http://github.com/pivotal/jasmine-gem/pull/213)
10
+ * Add Ruby 2.1.1 to Travis build #[212](http://github.com/pivotal/jasmine-gem/pull/212)
11
+ * Add Rails asset pipeline directories to spec pipeline #[211](http://github.com/pivotal/jasmine-gem/pull/211)
12
+ * Refactor Asset Pipeline handling. #[210](http://github.com/pivotal/jasmine-gem/pull/210)
13
+ * Try to ensure that rake tasks are only loaded once #[206](http://github.com/pivotal/jasmine-gem/pull/206)
14
+
15
+ ------
16
+
17
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,31 @@
1
+ # Jasmine Gem 2.0.3 Release Notes
2
+
3
+ These notes cover version 2.0.3
4
+
5
+ ## Summary
6
+
7
+ This is primarily a bugfix release.
8
+
9
+ ## Changes
10
+
11
+ * puts console.log messages from the browser.
12
+ * Allow a script to be called to configure the phantom webpage object
13
+
14
+ ## Fixes
15
+
16
+ * Tell sprockets we're in debug mode when requiring individual assets #[228](http://github.com/pivotal/jasmine-gem/issues/228)
17
+ * Use `exit` instead of `break` #[223](http://github.com/pivotal/jasmine-gem/issues/223)
18
+
19
+ ## Accepted Pull Requests
20
+
21
+ * Catching error when ipv6 is off #[227](http://github.com/pivotal/jasmine-gem/pull/227)
22
+ * Display separate commands on separate lines in the README #[224](http://github.com/pivotal/jasmine-gem/pull/224)
23
+ * Remove test app dependencies #[220](http://github.com/pivotal/jasmine-gem/pull/220)
24
+ * Fix rubinius test failures #[219](http://github.com/pivotal/jasmine-gem/pull/219)
25
+ * Set assets prefix in assets context #[216](http://github.com/pivotal/jasmine-gem/pull/216)
26
+ * Fix for tests that failed after dependency behavior changed. #[218](http://github.com/pivotal/jasmine-gem/pull/218)
27
+ * Fix config option typo in jasmine helper #[215](http://github.com/pivotal/jasmine-gem/pull/215)
28
+
29
+ ------
30
+
31
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,11 @@
1
+ # Jasmine Gem 2.1.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.1.0. See the
6
+ [jasmine-core release notes](https://github.com/pivotal/jasmine/blob/master/release_notes/2.1.0.md)
7
+ for more information.
8
+
9
+ ------
10
+
11
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,31 @@
1
+ # Jasmine Gem 2.2.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.2.0. See the
6
+ [jasmine-core release notes](https://github.com/pivotal/jasmine/blob/master/release_notes/2.2.0.md)
7
+ for more information.
8
+
9
+ ## Changes
10
+
11
+ * Allow minor and patch versions of jasmine-core dependency to change
12
+ * Show pending reason for specs
13
+ * Show section header for failing specs
14
+
15
+ ## Pull Requests & Issues
16
+
17
+ * Add a configuration option to show a full stack trace
18
+ - Merges [#236](https://github.com/jasmine/jasmine/issues/236) from @rrosenblum
19
+
20
+ * Check the railties dependencies instead of rails dependencies
21
+ - Merges [#235](https://github.com/jasmine/jasmine/issues/235) from @shingara
22
+
23
+ * Use the new build env on Travis
24
+ - Merges [#233](https://github.com/jasmine/jasmine/issues/233) from @joshk
25
+
26
+ * More precise readme regarding initialization [ci-skip]
27
+ - Merges [#232](https://github.com/jasmine/jasmine/issues/232) from @Intrepidd
28
+
29
+ ------
30
+
31
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,27 @@
1
+ # Jasmine Gem 2.3.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updated the jasmine-core dependency to 2.3.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.3.0.md)
7
+ for more information
8
+
9
+ ## Changes
10
+
11
+ * Bring back proper rails availability detection for specs
12
+ * Allow jasmine:ci task to stop a spec when an expectation failure occurs
13
+ * Extract jasmine:ci task running so it's more easily testable
14
+ * Don't print a symbol for disabled specs
15
+ * Properly format a disabled spec in the symbol summary
16
+
17
+ ## Pull Requests & Issues
18
+
19
+ * No longer check for the gem itself when looking for Rails
20
+ - Fixes [#238](https://github.com/jasmine/jasmine-gem/issues/238)
21
+
22
+ * Fix homepage URL in gemspec
23
+ - Merges [#237](https://github.com/jasmine/jasmine-gem/issues/237) from @jc00ke
24
+
25
+ ------
26
+
27
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,14 @@
1
+ # Jasmine Gem 2.3.1 Release Notes
2
+
3
+ ## Pull Requests & Issues
4
+
5
+ * Fix PathMapper overzealously replacing working directory
6
+ - Merges [#248](https://github.com/jasmine/jasmine-gem/issues/248) from @tdooner
7
+
8
+ * Resolve problem with Phantom 2.0.0
9
+ - Merges [#245](https://github.com/jasmine/jasmine-gem/issues/245) from @PatrickKing
10
+ - Fixes [#244](https://github.com/jasmine/jasmine-gem/issues/244)
11
+
12
+ ------
13
+
14
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,20 @@
1
+ # Jasmine Gem 2.4.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updated the jasmine-core dependency to 2.4.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.4.0.md)
7
+ for more information
8
+
9
+ ## Changes
10
+
11
+ * Allow jasmine:ci to run in random order
12
+
13
+ ## Pull Requests & Issues
14
+
15
+ * Rails 5 support
16
+ - Merges #254 from @tjgrathwell
17
+
18
+ ------
19
+
20
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,35 @@
1
+ # Jasmine Gem 2.5.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updated the jasmine-core dependency to 2.5.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.5.0.md)
7
+ for more information
8
+
9
+ ## Changes
10
+
11
+ * Update rails examples to spell out `generate`
12
+ - Fixes [#270](https://github.com/jasmine/jasmine-gem/issues/270)
13
+
14
+ * Update commented examples to be valid yaml
15
+ - Fixes [#266](https://github.com/jasmine/jasmine-gem/issues/266)
16
+
17
+ * Document non auto install configuration
18
+ - Merges [#264](https://github.com/jasmine/jasmine-gem/issues/264) from @eric-hu
19
+
20
+ * Clean up helper output
21
+ - Merges [#263](https://github.com/jasmine/jasmine-gem/issues/263) from @salbertson
22
+
23
+ * Fix for windows phantom execution
24
+ - Merges [#260](https://github.com/jasmine/jasmine-gem/issues/260) from @pf-bajorek
25
+
26
+ * Report failures in global afterAll
27
+ - Fixes [#811](https://github.com/jasmine/jasmine-gem/issues/811)
28
+
29
+ * Add functionality to specify specific suites to run
30
+ - Fixes [#234](https://github.com/jasmine/jasmine-gem/issues/234)
31
+ - Merges [#251](https://github.com/jasmine/jasmine-gem/issues/251) from @hwayne
32
+
33
+ ------
34
+
35
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,12 @@
1
+ # Jasmine Gem 2.5.1 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updated the jasmine-core dependency to 2.5.1. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.5.1.md)
7
+ for more information
8
+
9
+
10
+ ------
11
+
12
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,22 @@
1
+ # Jasmine Gem 2.5.2 Release Notes
2
+
3
+ ## Summary
4
+
5
+ ## Issues & Pull Request
6
+
7
+ * Explicitly set the `PORT` environment variable since Puma overrides the rack setting
8
+ - Fixes [#279](https://github.com/jasmine/jasmine-gem/issues/279)
9
+
10
+ * Disable Turbolinks 5
11
+ - Merge [#276](https://github.com/jasmine/jasmine-gem/issues/276) from @adimichele
12
+
13
+ * Include Rails 5 in the travis matrix and fix specs for it
14
+ - Fixes [#274](https://github.com/jasmine/jasmine-gem/issues/274)
15
+
16
+ * Fixed issue where spec path was incorrect when using an absolute path which contains spec/javascripts/
17
+ - Merges [#273](https://github.com/jasmine/jasmine-gem/issues/273) from @thoiberg
18
+
19
+
20
+ ------
21
+
22
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,17 @@
1
+ # Jasmine Gem 2.6.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updated the jasmine-core dependency to 2.6.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.6.0.md)
7
+ for more information
8
+
9
+ ## Changes
10
+
11
+ * Require action_view/base to trigger hook in sprockets-rails.
12
+ - Merges [#283](https://github.com/jasmine/jasmine-gem/issues/283) from @peret
13
+ - Fixes [#275](https://github.com/jasmine/jasmine-gem/issues/275)
14
+
15
+ ------
16
+
17
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,11 @@
1
+ # Jasmine Gem 2.6.1 Release Notes
2
+
3
+ ## Pull Requests and Issues
4
+
5
+ * Remove old code for legacy rack and set up the Jasmine application through proper channels
6
+ - Fixes [#284](https://github.com/jasmine/jasmine-gem/issues/284)
7
+
8
+
9
+ ------
10
+
11
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,28 @@
1
+ # Jasmine Gem 2.7.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.7.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.7.0.md)
7
+ for more information
8
+
9
+ ## Changes
10
+
11
+ * Properly pick up new spec and helper files without having to restart
12
+
13
+ ## Pull Requests and Issues
14
+
15
+ * catch Errno::EHOSTUNREACH while testing Jasmine#server_is_listening_on
16
+ - Merges [#288](https://github.com/jasmine/jasmine-gem/issues/288) from @doooby
17
+
18
+ * Catch error "Errno::EADDRNOTAVAIL", if check socket connection at cli mode
19
+ - Merges [#286](https://github.com/jasmine/jasmine-gem/issues/286) from @websi
20
+ - Fixes [#285](https://github.com/jasmine/jasmine-gem/issues/285)
21
+
22
+ * Remove old code for legacy rack and set up the Jasmine application through proper channels
23
+ - Fixes [#284](https://github.com/jasmine/jasmine-gem/issues/284)
24
+
25
+
26
+ ------
27
+
28
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,21 @@
1
+ # Jasmine Gem 2.8.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.8.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.8.0.md)
7
+ for more information
8
+
9
+ ## Pull Requests & Issues
10
+
11
+ * Add support to pass cli options to the phantomjs command
12
+ - Merges [#290](https://github.com/jasmine/jasmine-gem/issues/290) from @cice
13
+
14
+
15
+ * Listen for the server on the host we're going to load it on
16
+ - Fixes [#269](https://github.com/jasmine/jasmine-gem/issues/269)
17
+
18
+
19
+ ------
20
+
21
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,22 @@
1
+ # Jasmine Gem 2.9.0 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release updates the jasmine-core dependency to 2.9.0. See the
6
+ [jasmine-core release notes](https://github.com/jasmine/jasmine/blob/master/release_notes/2.9.0.md)
7
+ for more information
8
+
9
+ ## Changes
10
+
11
+ * Fixed supported Rails versions in README
12
+
13
+ * Better detection of disabled assets pipeline
14
+ - Merges [#294](https://github.com/jasmine/jasmine-gem/issues/294) from @thizzle
15
+
16
+ * In Jasmine. wait_for_listener use a parameter to decide what to listen for
17
+ - Merges [#292](https://github.com/jasmine/jasmine-gem/issues/292) from @myers
18
+
19
+
20
+ ------
21
+
22
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -0,0 +1,13 @@
1
+ # Jasmine Gem 2.99 Release Notes
2
+
3
+ ## Summary
4
+
5
+ This release is part of the upgrade path to Jasmine 3.0. Please see the [release notes for Jasmine-Core](https://github.com/jasmine/jasmine/blob/master/release_notes/2.99.md)
6
+
7
+ ## Changes
8
+
9
+ * Report deprecation warnings in CI output
10
+
11
+ ------
12
+
13
+ _Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_
@@ -5,10 +5,10 @@ describe "Jasmine::Application" do
5
5
  it "includes no-cache headers for specs" do
6
6
  pending
7
7
  get "/__spec__/example_spec.js"
8
- last_response.headers.should have_key("Cache-Control")
9
- last_response.headers["Cache-Control"].should == "max-age=0, private, must-revalidate"
8
+ expect(last_response.headers).to have_key("Cache-Control")
9
+ expect(last_response.headers["Cache-Control"]).to eq "max-age=0, private, must-revalidate"
10
10
  last_response.headers['Pragma'].each do |key|
11
- last_response.headers[key].should == 'no-cache'
11
+ expect(last_response.headers[key]).to eq 'no-cache'
12
12
  end
13
13
  end
14
14
 
@@ -11,29 +11,45 @@ describe 'Jasmine::Application' do
11
11
  builder = double('Rack::Builder.new')
12
12
  #Rack::Builder instance evals, so builder.run is invalid syntax,
13
13
  #this is the only way to stub out the 'run' dsl it gives to the block.
14
- Jasmine::Application.stub(:run).with(handler1).and_return(app1)
15
- Jasmine::Application.stub(:run).with(handler2).and_return(app2)
14
+ allow(Jasmine::Application).to receive(:run).with(handler1).and_return(app1)
15
+ allow(Jasmine::Application).to receive(:run).with(handler2).and_return(app2)
16
16
 
17
- builder.should_receive(:map).twice do |path, &app|
17
+ expect(builder).to receive(:map).twice do |path, &app|
18
18
  if path == '/foo'
19
- app.call.should == app1
19
+ expect(app.call).to eq app1
20
20
  elsif path == '/bar'
21
- app.call.should == app2
21
+ expect(app.call).to eq app2
22
22
  else
23
23
  raise 'Unexpected path passed'
24
24
  end
25
25
  end
26
26
 
27
- Jasmine::Application.app(config, builder).should == builder
27
+ expect(Jasmine::Application.app(config, builder)).to eq builder
28
28
  end
29
+
29
30
  it 'should run rack apps provided by the config' do
30
31
  app1 = double(:app1)
31
32
  app2 = double(:app2)
33
+ app3 = double(:app3)
34
+ app4 = double(:app4)
32
35
  block = lambda { 'foo' }
33
- config = double(:config, :rack_path_map => [], :rack_apps => [[app1, nil], [app2, block]])
36
+ config = double(:config, :rack_path_map => [], :rack_apps => [
37
+ { :app => app1 },
38
+ { :app => app2, :block => block },
39
+ { :app => app3, :args => [:foo, :bar], :block => block },
40
+ { :app => app4, :args => [:bar] }
41
+ ])
34
42
  builder = double('Rack::Builder.new')
35
- builder.should_receive(:use).with(app1)
36
- builder.should_receive(:use).with(app2, &block)
37
- Jasmine::Application.app(config, builder).should == builder
43
+ expect(builder).to receive(:use).with(app1)
44
+ expect(builder).to receive(:use) do |*args, &arg_block|
45
+ expect(args).to eq [app2]
46
+ expect(arg_block).to eq block
47
+ end
48
+ expect(builder).to receive(:use) do |*args, &arg_block|
49
+ expect(args).to eq [app3, :foo, :bar]
50
+ expect(arg_block).to eq block
51
+ end
52
+ expect(builder).to receive(:use).with(app4, :bar)
53
+ expect(Jasmine::Application.app(config, builder)).to eq builder
38
54
  end
39
- end
55
+ end
data/spec/base_spec.rb CHANGED
@@ -2,13 +2,34 @@ require 'spec_helper'
2
2
 
3
3
  describe Jasmine do
4
4
  it "should provide the root path" do
5
- File.stub(:dirname).and_return('lib/jasmine')
6
- File.should_receive(:expand_path) { |path| path }
7
- Jasmine.root.should == 'lib/jasmine'
5
+ allow(File).to receive(:dirname).and_return('lib/jasmine')
6
+ expect(File).to receive(:expand_path) { |path| path }
7
+ expect(Jasmine.root).to eq 'lib/jasmine'
8
8
  end
9
+
9
10
  it "should append passed file paths" do
10
- File.stub(:dirname).and_return('lib/jasmine')
11
- File.should_receive(:expand_path) { |path| path }
12
- Jasmine.root('subdir1', 'subdir2').should == File.join('lib/jasmine', 'subdir1', 'subdir2')
11
+ allow(File).to receive(:dirname).and_return('lib/jasmine')
12
+ expect(File).to receive(:expand_path) { |path| path }
13
+ expect(Jasmine.root('subdir1', 'subdir2')).to eq File.join('lib/jasmine', 'subdir1', 'subdir2')
14
+ end
15
+
16
+ describe '#load_spec' do
17
+ it 'assigns the spec to the spec path' do
18
+ Jasmine.load_spec("spec/test")
19
+ expect(Jasmine.config.spec_files.call).to eq [ "spec/test" ]
20
+ end
21
+
22
+ it 'does not assign a spec path if passed a nil' do
23
+ Jasmine.load_spec("spec/test")
24
+ Jasmine.load_spec(nil)
25
+ expect(Jasmine.config.spec_files.call).to eq [ "spec/test" ]
26
+ end
27
+
28
+ it 'does not override nonspec files' do
29
+ Jasmine.config.helper_files = lambda { ["aaa"] }
30
+ Jasmine.load_spec("spec/test")
31
+ expect(Jasmine.config.spec_files.call).to eq [ "spec/test" ]
32
+ expect(Jasmine.config.helper_files.call).to eq ["aaa"]
33
+ end
13
34
  end
14
35
  end