wash_out 0.9.2 → 0.11.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.travis.yml +35 -4
  4. data/Appraisals +8 -12
  5. data/Gemfile +1 -1
  6. data/README.md +85 -7
  7. data/Rakefile +15 -5
  8. data/app/helpers/wash_out_helper.rb +59 -24
  9. data/app/views/{wash_with_soap → wash_out}/document/error.builder +0 -0
  10. data/app/views/{wash_with_soap → wash_out}/document/response.builder +7 -0
  11. data/app/views/{wash_with_soap → wash_out}/document/wsdl.builder +14 -14
  12. data/app/views/{wash_with_soap → wash_out}/rpc/error.builder +0 -0
  13. data/app/views/{wash_with_soap → wash_out}/rpc/response.builder +8 -1
  14. data/app/views/{wash_with_soap → wash_out}/rpc/wsdl.builder +15 -15
  15. data/gemfiles/rails_3.2.13.gemfile +21 -0
  16. data/gemfiles/rails_4.0.0.gemfile +20 -0
  17. data/gemfiles/rails_4.1.0.gemfile +20 -0
  18. data/gemfiles/rails_4.2.0.gemfile +20 -0
  19. data/gemfiles/rails_5.0.0.beta2.gemfile +19 -0
  20. data/gemfiles/rails_5.0.0.gemfile +19 -0
  21. data/lib/wash_out/dispatcher.rb +96 -39
  22. data/lib/wash_out/param.rb +14 -2
  23. data/lib/wash_out/router.rb +52 -22
  24. data/lib/wash_out/soap.rb +11 -0
  25. data/lib/wash_out/version.rb +1 -1
  26. data/lib/wash_out/wsse.rb +3 -3
  27. data/lib/wash_out.rb +32 -5
  28. data/spec/dummy/config/environments/test.rb +1 -0
  29. data/spec/fixtures/nested_refs_to_arrays.xml +19 -0
  30. data/spec/fixtures/ref_to_one_array.xml +11 -0
  31. data/spec/fixtures/refs_to_arrays.xml +16 -0
  32. data/spec/lib/wash_out/dispatcher_spec.rb +124 -17
  33. data/spec/lib/wash_out/middleware_spec.rb +8 -8
  34. data/spec/lib/wash_out/param_spec.rb +43 -11
  35. data/spec/lib/wash_out/router_spec.rb +33 -5
  36. data/spec/lib/wash_out/type_spec.rb +9 -9
  37. data/spec/lib/wash_out_spec.rb +361 -103
  38. data/spec/spec_helper.rb +26 -4
  39. metadata +18 -9
data/spec/spec_helper.rb CHANGED
@@ -24,6 +24,8 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
24
24
  RSpec.configure do |config|
25
25
  require 'rspec/expectations'
26
26
  config.include RSpec::Matchers
27
+ config.filter_run focus: true
28
+ config.run_all_when_everything_filtered = true
27
29
 
28
30
  config.mock_with :rspec
29
31
  config.before(:all) do
@@ -50,12 +52,20 @@ HTTPI.adapter = :rack
50
52
 
51
53
  HTTPI::Adapter::Rack.mount 'app', Dummy::Application
52
54
  Dummy::Application.routes.draw do
53
- wash_out :api
55
+ namespace :route do
56
+ scope module: 'space' do
57
+ wash_out :api
58
+ end
59
+ end
54
60
  end
55
61
 
56
62
  def mock_controller(options = {}, &block)
57
- Object.send :remove_const, :ApiController if defined?(ApiController)
58
- Object.send :const_set, :ApiController, Class.new(ApplicationController) {
63
+ Object.send :const_set, :Route, Module.new unless defined?(Route)
64
+ Route.send :const_set, :Space, Module.new unless defined?(Route::Space)
65
+ Route::Space.send :remove_const, :ApiController if defined?(Route::Space::ApiController)
66
+ Route::Space.send :const_set, :ApiController, Class.new(ApplicationController) {
67
+ include RSpec::Matchers
68
+
59
69
  soap_service options.reverse_merge({
60
70
  snakecase_input: true,
61
71
  camelize_wsdl: true,
@@ -64,5 +74,17 @@ def mock_controller(options = {}, &block)
64
74
  class_exec &block if block
65
75
  }
66
76
 
67
- ActiveSupport::Dependencies::Reference.instance_variable_get(:'@store').delete('ApiController')
77
+ ActiveSupport::Dependencies::Reference.instance_variable_get(:'@store').delete('Route::Space::ApiController')
78
+ end
79
+
80
+ unless defined?(silence_stream) # Rails 5
81
+ def silence_stream(stream)
82
+ old_stream = stream.dup
83
+ stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
84
+ stream.sync = true
85
+ yield
86
+ ensure
87
+ stream.reopen(old_stream)
88
+ old_stream.close
89
+ end
68
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wash_out
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Staal
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-19 00:00:00.000000000 Z
12
+ date: 2016-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nori
@@ -42,12 +42,18 @@ files:
42
42
  - README.md
43
43
  - Rakefile
44
44
  - app/helpers/wash_out_helper.rb
45
- - app/views/wash_with_soap/document/error.builder
46
- - app/views/wash_with_soap/document/response.builder
47
- - app/views/wash_with_soap/document/wsdl.builder
48
- - app/views/wash_with_soap/rpc/error.builder
49
- - app/views/wash_with_soap/rpc/response.builder
50
- - app/views/wash_with_soap/rpc/wsdl.builder
45
+ - app/views/wash_out/document/error.builder
46
+ - app/views/wash_out/document/response.builder
47
+ - app/views/wash_out/document/wsdl.builder
48
+ - app/views/wash_out/rpc/error.builder
49
+ - app/views/wash_out/rpc/response.builder
50
+ - app/views/wash_out/rpc/wsdl.builder
51
+ - gemfiles/rails_3.2.13.gemfile
52
+ - gemfiles/rails_4.0.0.gemfile
53
+ - gemfiles/rails_4.1.0.gemfile
54
+ - gemfiles/rails_4.2.0.gemfile
55
+ - gemfiles/rails_5.0.0.beta2.gemfile
56
+ - gemfiles/rails_5.0.0.gemfile
51
57
  - init.rb
52
58
  - lib/wash_out.rb
53
59
  - lib/wash_out/configurable.rb
@@ -85,6 +91,9 @@ files:
85
91
  - spec/dummy/public/favicon.ico
86
92
  - spec/dummy/public/stylesheets/.gitkeep
87
93
  - spec/dummy/script/rails
94
+ - spec/fixtures/nested_refs_to_arrays.xml
95
+ - spec/fixtures/ref_to_one_array.xml
96
+ - spec/fixtures/refs_to_arrays.xml
88
97
  - spec/lib/wash_out/dispatcher_spec.rb
89
98
  - spec/lib/wash_out/middleware_spec.rb
90
99
  - spec/lib/wash_out/param_spec.rb
@@ -114,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
123
  version: '0'
115
124
  requirements: []
116
125
  rubyforge_project:
117
- rubygems_version: 2.2.2
126
+ rubygems_version: 2.5.1
118
127
  signing_key:
119
128
  specification_version: 4
120
129
  summary: Dead simple Rails 3 SOAP server library