screw-unit 0.3.3 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/CHANGES +10 -0
  2. data/Rakefile +27 -25
  3. data/VERSION.yml +4 -0
  4. data/bin/screw_unit_server +14 -4
  5. data/core/EXAMPLE.html +1 -1
  6. data/core/example/spec/suite.html +1 -1
  7. data/core/lib/jquery-1.3.2.js +4376 -0
  8. data/core/lib/jquery.fn.js +2 -1
  9. data/core/lib/screw.behaviors.js +8 -7
  10. data/core/lib/screw.builder.js +34 -19
  11. data/core/lib/screw.css +1 -1
  12. data/core/lib/screw.events.js +5 -5
  13. data/core/lib/screw.matchers.js +59 -2
  14. data/core/spec/suite.html +2 -1
  15. data/core/spec/with_screw_context_spec.js +9 -0
  16. data/lib/screw_unit.rb +13 -16
  17. data/lib/screw_unit/representations.rb +2 -0
  18. data/lib/screw_unit/{resources/spec.rb → representations/spec.html.rb} +55 -39
  19. data/spec/functional/functional_spec.rb +1 -1
  20. data/spec/functional/functional_spec_helper.rb +21 -33
  21. data/spec/functional/functional_spec_server_starter.rb +68 -0
  22. data/spec/unit/js_test_core/specs/spec_file_spec.rb +52 -18
  23. data/spec/unit/unit_spec_helper.rb +24 -91
  24. data/vendor/js-test-core/CHANGES +8 -0
  25. data/vendor/js-test-core/Rakefile +1 -0
  26. data/vendor/js-test-core/lib/js_test_core.rb +22 -14
  27. data/vendor/js-test-core/lib/js_test_core/app.rb +12 -0
  28. data/vendor/js-test-core/lib/js_test_core/client.rb +21 -9
  29. data/vendor/js-test-core/lib/js_test_core/configuration.rb +35 -0
  30. data/vendor/js-test-core/lib/js_test_core/extensions.rb +1 -1
  31. data/vendor/js-test-core/lib/js_test_core/extensions/selenium/client/driver.rb +7 -0
  32. data/vendor/js-test-core/lib/js_test_core/models.rb +8 -0
  33. data/vendor/js-test-core/lib/js_test_core/models/selenium_session.rb +80 -0
  34. data/vendor/js-test-core/lib/js_test_core/representations.rb +11 -0
  35. data/vendor/js-test-core/lib/js_test_core/representations/dir.html.rb +24 -0
  36. data/vendor/js-test-core/lib/js_test_core/representations/not_found.html.rb +15 -0
  37. data/vendor/js-test-core/lib/js_test_core/representations/page.html.rb +41 -0
  38. data/vendor/js-test-core/lib/js_test_core/representations/spec.html.rb +24 -0
  39. data/vendor/js-test-core/lib/js_test_core/resources.rb +13 -7
  40. data/vendor/js-test-core/lib/js_test_core/resources/core_file.rb +19 -0
  41. data/vendor/js-test-core/lib/js_test_core/resources/file.rb +42 -20
  42. data/vendor/js-test-core/lib/js_test_core/resources/implementations_deprecation.rb +12 -0
  43. data/vendor/js-test-core/lib/js_test_core/resources/not_found.rb +35 -0
  44. data/vendor/js-test-core/lib/js_test_core/resources/resource.rb +16 -0
  45. data/vendor/js-test-core/lib/js_test_core/resources/selenium_session.rb +104 -0
  46. data/vendor/js-test-core/lib/js_test_core/resources/spec_file.rb +63 -0
  47. data/vendor/js-test-core/lib/js_test_core/resources/web_root.rb +5 -60
  48. data/vendor/js-test-core/{vendor/thin-rest/README → spec/example_core/subdir/SubDirFile.js} +0 -0
  49. data/vendor/js-test-core/spec/example_specs/custom_dir_and_suite/passing_spec.js +6 -0
  50. data/vendor/js-test-core/spec/example_specs/custom_suite.html +8 -0
  51. data/vendor/js-test-core/spec/example_specs/foo/failing_spec.js +1 -1
  52. data/vendor/js-test-core/spec/example_specs/foo/passing_spec.js +1 -1
  53. data/vendor/js-test-core/spec/spec_helpers/be_http.rb +32 -0
  54. data/vendor/js-test-core/spec/spec_helpers/example_group.rb +36 -0
  55. data/vendor/js-test-core/spec/spec_helpers/fake_selenium_driver.rb +27 -0
  56. data/vendor/js-test-core/spec/spec_helpers/show_test_exceptions.rb +22 -0
  57. data/vendor/js-test-core/spec/unit/js_test_core/client_spec.rb +35 -10
  58. data/vendor/js-test-core/spec/unit/js_test_core/configuration_spec.rb +44 -0
  59. data/vendor/js-test-core/spec/unit/js_test_core/models/selenium_session_spec.rb +85 -0
  60. data/vendor/js-test-core/spec/unit/js_test_core/resources/core_file_spec.rb +60 -0
  61. data/vendor/js-test-core/spec/unit/js_test_core/resources/file_spec.rb +54 -63
  62. data/vendor/js-test-core/spec/unit/js_test_core/resources/implementations_deprecation_spec.rb +18 -0
  63. data/vendor/js-test-core/spec/unit/js_test_core/resources/not_found_spec.rb +51 -0
  64. data/vendor/js-test-core/spec/unit/js_test_core/resources/selenium_session_spec.rb +362 -0
  65. data/vendor/js-test-core/spec/unit/js_test_core/resources/spec_file_spec.rb +120 -0
  66. data/vendor/js-test-core/spec/unit/js_test_core/resources/web_root_spec.rb +15 -19
  67. data/vendor/js-test-core/spec/unit/unit_spec_helper.rb +16 -149
  68. data/vendor/js-test-core/vendor/lucky-luciano/README.markdown +7 -0
  69. data/vendor/js-test-core/vendor/lucky-luciano/lib/lucky_luciano.rb +4 -0
  70. data/vendor/js-test-core/vendor/lucky-luciano/lib/lucky_luciano/resource.rb +135 -0
  71. data/vendor/js-test-core/vendor/lucky-luciano/lib/lucky_luciano/rspec.rb +4 -0
  72. data/vendor/js-test-core/vendor/lucky-luciano/lib/lucky_luciano/rspec/be_http.rb +32 -0
  73. data/vendor/js-test-core/vendor/lucky-luciano/spec/lucky_luciano/resource_spec.rb +231 -0
  74. data/vendor/js-test-core/vendor/lucky-luciano/spec/spec_helper.rb +48 -0
  75. data/vendor/js-test-core/vendor/{thin-rest → lucky-luciano}/spec/spec_suite.rb +1 -2
  76. metadata +134 -145
  77. data/core/lib/jquery-1.2.6.js +0 -3549
  78. data/lib/screw_unit/resources.rb +0 -2
  79. data/spec/unit/js_test_core/specs/spec_dir_spec.rb +0 -38
  80. data/vendor/js-test-core/lib/js_test_core/rack.rb +0 -2
  81. data/vendor/js-test-core/lib/js_test_core/rack/commonlogger.rb +0 -5
  82. data/vendor/js-test-core/lib/js_test_core/rails_server.rb +0 -22
  83. data/vendor/js-test-core/lib/js_test_core/resources/dir.rb +0 -67
  84. data/vendor/js-test-core/lib/js_test_core/resources/file_not_found.rb +0 -11
  85. data/vendor/js-test-core/lib/js_test_core/resources/runner.rb +0 -107
  86. data/vendor/js-test-core/lib/js_test_core/resources/session.rb +0 -44
  87. data/vendor/js-test-core/lib/js_test_core/resources/session_finish.rb +0 -17
  88. data/vendor/js-test-core/lib/js_test_core/resources/specs/spec_dir.rb +0 -46
  89. data/vendor/js-test-core/lib/js_test_core/resources/specs/spec_file.rb +0 -17
  90. data/vendor/js-test-core/lib/js_test_core/selenium.rb +0 -2
  91. data/vendor/js-test-core/lib/js_test_core/selenium/selenium_driver.rb +0 -5
  92. data/vendor/js-test-core/lib/js_test_core/server.rb +0 -50
  93. data/vendor/js-test-core/lib/js_test_core/thin.rb +0 -3
  94. data/vendor/js-test-core/lib/js_test_core/thin/backends/js_test_core_server.rb +0 -9
  95. data/vendor/js-test-core/lib/js_test_core/thin/js_test_core_connection.rb +0 -8
  96. data/vendor/js-test-core/spec/unit/js_test_core/rails_server_spec.rb +0 -45
  97. data/vendor/js-test-core/spec/unit/js_test_core/resources/dir_spec.rb +0 -52
  98. data/vendor/js-test-core/spec/unit/js_test_core/resources/file_not_found_spec.rb +0 -16
  99. data/vendor/js-test-core/spec/unit/js_test_core/resources/runners/runner_spec.rb +0 -303
  100. data/vendor/js-test-core/spec/unit/js_test_core/resources/session_finish_spec.rb +0 -79
  101. data/vendor/js-test-core/spec/unit/js_test_core/resources/session_spec.rb +0 -82
  102. data/vendor/js-test-core/spec/unit/js_test_core/resources/specs/spec_dir_spec.rb +0 -105
  103. data/vendor/js-test-core/spec/unit/js_test_core/resources/specs/spec_file_spec.rb +0 -42
  104. data/vendor/js-test-core/spec/unit/js_test_core/server_spec.rb +0 -117
  105. data/vendor/js-test-core/spec/unit/thin/js_test_core_connection_spec.rb +0 -6
  106. data/vendor/js-test-core/vendor/thin-rest/CHANGES +0 -2
  107. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest.rb +0 -9
  108. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest/connection.rb +0 -116
  109. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest/extensions.rb +0 -3
  110. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest/extensions/object.rb +0 -21
  111. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest/resource.rb +0 -108
  112. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest/resource_invalid.rb +0 -4
  113. data/vendor/js-test-core/vendor/thin-rest/lib/thin_rest/routing_error.rb +0 -5
  114. data/vendor/js-test-core/vendor/thin-rest/spec/thin_rest/connection_spec.rb +0 -207
  115. data/vendor/js-test-core/vendor/thin-rest/spec/thin_rest/resource_spec.rb +0 -127
  116. data/vendor/js-test-core/vendor/thin-rest/spec/thin_rest_spec_helper.rb +0 -124
@@ -1,124 +0,0 @@
1
- dir = File.dirname(__FILE__)
2
- $LOAD_PATH.unshift(File.expand_path("#{dir}/../lib"))
3
- require "thin_rest"
4
- require "spec"
5
- require "guid"
6
-
7
- Spec::Runner.configure do |config|
8
- config.mock_with :rr
9
-
10
- config.before do
11
- stub(EventMachine).send_data {raise "EventMachine.send_data needs to be stubbed or mocked out"}
12
- stub(EventMachine).close_connection {raise "EventMachine.close_connection needs to be stubbed or mocked out"}
13
- stub(EventMachine).close_connection_after_writing {raise "EventMachine.close_connection_after_writing needs to be stubbed or mocked out"}
14
- stub(EventMachine).set_comm_inactivity_timeout {raise "EventMachine.set_comm_inactivity_timeout needs to be stubbed or mocked out"}
15
- stub(EventMachine).report_connection_error_status {0}
16
- stub(EventMachine).add_timer
17
- Thin::Logging.silent = !self.class.thin_logging
18
- Thin::Logging.debug = self.class.thin_logging
19
- Thin::Logging.trace = false
20
- end
21
- end
22
-
23
- module Spec::Example::ExampleGroupMethods
24
- def thin_logging
25
- if @thin_logging.nil?
26
- return false
27
- else
28
- @thin_logging
29
- end
30
- end
31
- attr_writer :thin_logging
32
- end
33
-
34
- module Spec::Example::ExampleMethods
35
- def create_connection(guid = Guid.new.to_s)
36
- connection = TestConnection.new(guid)
37
- connection.backend = Object.new
38
- stub(connection.backend).connection_finished
39
- connection
40
- end
41
-
42
- def stub_send_data
43
- stub(EventMachine).send_data do |signature, data, data_length|
44
- data_length
45
- end
46
- end
47
- end
48
-
49
- class TestConnection < ThinRest::Connection
50
- def root_resource
51
- Root.new(:connection => self)
52
- end
53
- end
54
-
55
- class Root < ThinRest::Resource
56
- property :connection
57
- route 'subresource', 'Subresource'
58
- route 'another_subresource', 'AnotherSubresource'
59
- route 'block_subresource' do |properties, name|
60
- BlockSubresource.new(properties.merge(:foobar => foobar))
61
- end
62
- route 'error_subresource', 'ErrorSubresource'
63
- route 'wrong_property' do |properties, name|
64
- WrongPropertySubresource.new(properties.merge(:baz => name))
65
- end
66
-
67
-
68
- def foobar
69
- :baz
70
- end
71
- end
72
-
73
- class Subresource < ThinRest::Resource
74
- def do_get
75
- "GET response"
76
- end
77
-
78
- def do_post
79
- "POST response"
80
- end
81
-
82
- def do_put
83
- "PUT response"
84
- end
85
-
86
- def do_delete
87
- "DELETE response"
88
- end
89
- end
90
-
91
- class AnotherSubresource < ThinRest::Resource
92
- def do_get
93
- "Another GET response"
94
- end
95
-
96
- def do_post
97
- "Another POST response"
98
- end
99
-
100
- def do_put
101
- "Another PUT response"
102
- end
103
-
104
- def do_delete
105
- "Another DELETE response"
106
- end
107
- end
108
-
109
- class BlockSubresource < ThinRest::Resource
110
- property :foobar
111
- end
112
-
113
- class ErrorSubresource < ThinRest::Resource
114
- def get
115
- raise "An Error"
116
- end
117
- end
118
-
119
- class WrongPropertySubresource < ThinRest::Resource
120
- property :foobar
121
- def get
122
- "Wrong Property"
123
- end
124
- end