washout_builder 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGMwZWQyMDJkY2E1OTU1MzBhOGVhY2YyMDE4NTc3ZWUyM2MwODA2NQ==
4
+ MTZiZmFiY2Y3NjViZDhiZWQ0Zjk0YWNmOWMxZWRkZjkwOTMyY2VmZg==
5
5
  data.tar.gz: !binary |-
6
- MjE4YjQyNjI5NjIwZWMzMjI5YmQyNGEwNGUwMWFlOTI0ZGJjM2I2ZA==
6
+ NDUxNTFiNTdkYjNjYzQ0MWRhMGM5YTU5OTc1M2JkYTZlM2Q1MjdjMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDhlODA4MzAzYzU4YmE0NDE0YWYyNDA5NmYyNjkzNjE4NWViNGIzZGJlMmI1
10
- ODQyN2ZjZDc0MTU4MGUxZTgzMmYxYWM5YTc0OGE5YjFlODRmYjgxMWIxMTAz
11
- MWFlZWI0ZGM0ZjZjZTg2ZDE0ZmQ4MmRjOWU1OGFlN2ZlODQwNWI=
9
+ MjVjZTQyYjBkZDk0NGZjNjVhMzhiY2VlOGY1NDkwYzAwYmViMmE4YzM1ZTk3
10
+ OGE5YzgyZWQwNTAxNzQ4ZWIzNDc3ODU0NjYyN2U5YmQ1ZmM2ZDBmNjY4YzFj
11
+ NTRmNmQ3YTM5YTYzOGRiOWEzNjE0ZjQwOWMyMjA0OGI3MjU1ZjY=
12
12
  data.tar.gz: !binary |-
13
- N2RkMjg5MGYxODQxZWI2NDRlYTM3ZWY4NmI0M2ZkYmVlYjM3YjEzMDgzMjIy
14
- YWQ3OGYzYTZiOGE0NDNmMzAyNzBhMjQ3ZjA4YzZmNWIwNzUwNTJkNzU1MWEw
15
- ODU5OGQxYmQwMTNkY2FjYjJiNWM2YzZiMDkwYTgxMWYxYzY0M2Q=
13
+ NTczMDAyMzQ4NTc0OTA0NmIwNDkzYTdhZmNkNDYwMWZhODAxYWNlYzg2ZDYy
14
+ MzlkOTFkN2M5ZDNmYzYxZDcwMmY0MzMyOTM3MDcwZjVjNzE3N2VlZjFhYmFj
15
+ ZmVkMzBiYmVjYjg5MzE1ZjVhMDU5N2IxMTE1ODExYzRkZWE5YzE=
@@ -181,12 +181,18 @@ module WashoutBuilderHelper
181
181
  xml.p "Return value:"
182
182
  xml.ul {
183
183
  xml.li {
184
- if !formats[:out].nil?
185
-
184
+ unless formats[:out].nil?
185
+ complex_class = formats[:out][0].get_complex_class_name
186
186
  if WashoutBuilder::Type::BASIC_TYPES.include?(formats[:out][0].type)
187
187
  xml.span("class" => "pre") { |xml| xml.span("class" => "blue") { |sp| sp << "#{formats[:out][0].type}" } }
188
188
  else
189
- xml.span("class" => "pre") { xml.a("href" => "##{formats[:out][0].type}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{formats[:out][0].type}" } } }
189
+ unless complex_class.nil?
190
+ if formats[:out][0].multiplied == false
191
+ xml.span("class" => "pre") { xml.a("href" => "##{complex_class}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"#{complex_class}" } } }
192
+ else
193
+ xml.span("class" => "pre") { xml.a("href" => "##{complex_class}") { |xml| xml.span("class" => "lightBlue") { |y| y<<"Array of #{complex_class}" } } }
194
+ end
195
+ end
190
196
  end
191
197
  else
192
198
  xml.span("class" => "pre") { |sp| sp << "void" }
@@ -74,9 +74,9 @@ module WashoutBuilder
74
74
  defined = defined.collect {|operation, formats| formats[:raises].is_a?(Array) ? formats[:raises] : [formats[:raises]] }.flatten.select { |x| x.is_a?(Class) && (x.ancestors.include?(WashOut::SOAPError) || x.ancestors.include?(SOAPError) ) } unless defined.blank?
75
75
  fault_types = []
76
76
  if defined.blank?
77
- defined = [SOAPError]
77
+ defined = [WashOut::SOAPError]
78
78
  else
79
- defined << SOAPError
79
+ defined << WashOut::SOAPError
80
80
  end
81
81
  defined.each{ |exception_class| exception_class.get_fault_class_ancestors( fault_types, true)} unless defined.blank?
82
82
  complex_types = extract_nested_complex_types_from_exceptions(fault_types)
@@ -1,3 +1,3 @@
1
1
  module WashoutBuilder
2
- VERSION = "0.10.3"
2
+ VERSION = "0.10.4"
3
3
  end
@@ -1,51 +1,46 @@
1
1
  #encoding:utf-8
2
2
 
3
3
  require 'spec_helper'
4
+ mock_controller do
5
+ soap_action 'dispatcher_method', :args => nil, :return => nil
4
6
 
5
- describe WashoutBuilder::Dispatcher do
6
-
7
- class Dispatcher < ApplicationController
8
- soap_service
9
-
10
- def params
11
- @_params
12
- end
7
+ def dispatcher_method
8
+ raise SOAPError.new("some message", 1001)
13
9
  end
10
+ end
14
11
 
12
+ describe ApiController, :type => :controller do
15
13
 
16
-
17
-
18
- describe "#_load_params" do
19
- let(:dispatcher) { Dispatcher.new }
20
- let(:soap_config) {
21
- OpenStruct.new(
22
- WashOut::Rails::Engine.config.wash_out.merge( { camelize_wsdl: false })
23
- )
24
- }
25
- it "should load params for an array" do
26
- spec = WashOut::Param.parse_def(soap_config, {:my_array => [:integer] } )
27
- xml_data = {:my_array => [1, 2, 3]}
28
- dispatcher._load_params(spec, xml_data).should == {"my_array" => [1, 2, 3]}
29
- end
30
-
31
- it "should load params for an empty array" do
32
- spec = WashOut::Param.parse_def(soap_config, {:my_array => [:integer] } )
33
- xml_data = {}
34
- dispatcher._load_params(spec, xml_data).should == {}
35
- end
36
-
37
- it "should load params for a nested array" do
38
- spec = WashOut::Param.parse_def(soap_config, {:nested => {:my_array => [:integer]}} )
39
- xml_data = {:nested => {:my_array => [1, 2, 3]}}
40
- dispatcher._load_params(spec, xml_data).should == {"nested" => {"my_array" => [1, 2, 3]}}
41
- end
42
-
43
- it "should load params for an empty nested array" do
44
- spec = WashOut::Param.parse_def(soap_config, {:nested => {:empty => [:integer] }} )
45
- xml_data = {:nested => nil}
46
- dispatcher._load_params(spec, xml_data).should == {"nested" => {}}
47
- end
48
-
14
+ let(:document) { WashoutBuilder::Document::Generator.new}
15
+
16
+ render_views(false)
17
+
18
+ before(:each) do
19
+ WashoutBuilder::Document::Generator.stub(:new).and_return(document)
49
20
  end
50
-
51
- end
21
+
22
+ it "inits the document generator" do
23
+ WashoutBuilder::Document::Generator.expects(:new).with(
24
+ :config => ApiController.soap_config,
25
+ :service_class => ApiController,
26
+ :soap_actions => {'dispatcher_method' =>
27
+ {:args => nil, :return => nil, :in => [], :out => [], :to => 'dispatcher_method'}
28
+ }
29
+ )
30
+ get :_generate_doc
31
+ end
32
+
33
+ it "verifies render" do
34
+ controller.expects(:render).with(nil)
35
+ controller.expects(:render).with(:template => "wash_with_html/doc", :layout => false,
36
+ :content_type => 'text/html')
37
+ get :_generate_doc
38
+ end
39
+
40
+ it "renders the template" , :fails =>true do
41
+ get :_generate_doc
42
+ response.should render_template("wash_with_html/doc")
43
+ end
44
+
45
+
46
+ end
@@ -0,0 +1,10 @@
1
+ #encoding:utf-8
2
+ require 'spec_helper'
3
+
4
+
5
+ describe WashoutBuilder::Document::Generator do
6
+
7
+ let(:generator) { FactoryGirl.build(:generator)}
8
+
9
+
10
+ end
@@ -4,18 +4,17 @@ require 'spec_helper'
4
4
 
5
5
  describe WashoutBuilder::Type do
6
6
 
7
- [ "string",
8
- "integer",
9
- "double",
10
- "boolean",
11
- "date",
12
- "datetime",
13
- "float",
14
- "time",
15
- "int"].each do |type|
16
- it "defines a list of types" do
17
- WashoutBuilder::Type::BASIC_TYPES.should include(type)
18
- end
7
+ it "defines a list of types" do
8
+ WashoutBuilder::Type::BASIC_TYPES.should eq([
9
+ "string",
10
+ "integer",
11
+ "double",
12
+ "boolean",
13
+ "date",
14
+ "datetime",
15
+ "float",
16
+ "time",
17
+ "int"])
19
18
  end
20
-
19
+
21
20
  end
data/spec/spec_helper.rb CHANGED
@@ -21,6 +21,13 @@ require "pry"
21
21
  require "savon"
22
22
  require 'wash_out'
23
23
 
24
+ require 'capybara/rspec'
25
+ require 'capybara/rails'
26
+ require 'capybara/firebug/rspec'
27
+ require 'forgery/forgery'
28
+ require 'webmock/rspec'
29
+ require 'headless'
30
+
24
31
  Rails.backtrace_cleaner.remove_silencers!
25
32
 
26
33
  # Load support files
@@ -29,6 +36,22 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
29
36
  RSpec.configure do |config|
30
37
  require 'rspec/expectations'
31
38
  config.include RSpec::Matchers
39
+
40
+ # mock framework
41
+ # config.mock_with :mocha
42
+
43
+ #config.include Savon::Spec::Macros
44
+ #config.include AbstractController::Translation
45
+
46
+ config.before(:suite) do
47
+ # Reload factories in spec/factories.
48
+ FactoryGirl.reload
49
+ # Blocks all remote HTTP requests by default, they need to be stubbed.
50
+ WebMock.disable_net_connect!(:allow_localhost => true)
51
+ if !RUBY_PLATFORM.downcase.include?('darwin') && !ENV['NO_HEADLESS']
52
+ Headless.new(reuse: false, destroy_on_exit: false).start
53
+ end
54
+ end
32
55
 
33
56
  config.mock_with :rspec
34
57
  config.before(:all) do
@@ -62,10 +85,10 @@ def mock_controller(options = {}, &block)
62
85
  Object.send :remove_const, :ApiController if defined?(ApiController)
63
86
  Object.send :const_set, :ApiController, Class.new(ApplicationController) {
64
87
  soap_service options.reverse_merge({
65
- snakecase_input: true,
66
- camelize_wsdl: true,
67
- namespace: false
68
- })
88
+ snakecase_input: true,
89
+ camelize_wsdl: true,
90
+ namespace: false
91
+ })
69
92
  class_exec &block if block
70
93
  }
71
94
 
@@ -4,10 +4,10 @@ Gem::Specification.new do |s|
4
4
  s.name = "washout_builder"
5
5
  s.version = WashoutBuilder::VERSION
6
6
  s.platform = Gem::Platform::RUBY
7
- s.summary = "WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/)"
7
+ s.summary = "WashOut Soap Service HTML-Documentation generator (extends WashOut https://github.com/inossidabile/wash_out/)"
8
8
  s.email = "raoul_ice@yahoo.com"
9
9
  s.homepage = "http://github.com/bogdanRada/washout_builder/"
10
- s.description = "WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/) "
10
+ s.description = "WashOut Soap Service HTML-Documentation generator (extends WashOut https://github.com/inossidabile/wash_out/) "
11
11
  s.authors = ["bogdanRada"]
12
12
  s.date = "2013-11-20"
13
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: washout_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada
@@ -38,7 +38,8 @@ dependencies:
38
38
  - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.0.0
41
- description: ! 'WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/) '
41
+ description: ! 'WashOut Soap Service HTML-Documentation generator (extends WashOut
42
+ https://github.com/inossidabile/wash_out/) '
42
43
  email: raoul_ice@yahoo.com
43
44
  executables: []
44
45
  extensions: []
@@ -98,8 +99,6 @@ files:
98
99
  - spec/lib/washout_builder/document/complex_type_spec.rb
99
100
  - spec/lib/washout_builder/document/generator_spec.rb
100
101
  - spec/lib/washout_builder/document/virtus_model_spec.rb
101
- - spec/lib/washout_builder/engine_spec.rb
102
- - spec/lib/washout_builder/soap_spec.rb
103
102
  - spec/lib/washout_builder/type_spec.rb
104
103
  - spec/lib/washout_builder_spec.rb
105
104
  - spec/spec_helper.rb
@@ -127,7 +126,7 @@ rubyforge_project:
127
126
  rubygems_version: 2.1.11
128
127
  signing_key:
129
128
  specification_version: 4
130
- summary: WashOut Soap Service Documentation builder (extends WashOut https://github.com/inossidabile/wash_out/)
129
+ summary: WashOut Soap Service HTML-Documentation generator (extends WashOut https://github.com/inossidabile/wash_out/)
131
130
  test_files:
132
131
  - spec/app/controllers/washout_builder_controller_spec.rb
133
132
  - spec/app/helpers/washout_builder_helper_spec.rb
@@ -160,8 +159,6 @@ test_files:
160
159
  - spec/lib/washout_builder/document/complex_type_spec.rb
161
160
  - spec/lib/washout_builder/document/generator_spec.rb
162
161
  - spec/lib/washout_builder/document/virtus_model_spec.rb
163
- - spec/lib/washout_builder/engine_spec.rb
164
- - spec/lib/washout_builder/soap_spec.rb
165
162
  - spec/lib/washout_builder/type_spec.rb
166
163
  - spec/lib/washout_builder_spec.rb
167
164
  - spec/spec_helper.rb
@@ -1,6 +0,0 @@
1
- require 'spec_helper'
2
-
3
-
4
- describe WashoutBuilder::Engine do
5
-
6
- end
@@ -1,15 +0,0 @@
1
- #encoding:utf-8
2
-
3
- require 'spec_helper'
4
-
5
- describe WashoutBuilder::SOAP do
6
-
7
- # [
8
- # WashoutBuilder::Dispatcher,
9
- # WashOut::Rails::Controller
10
- # ].each do |extension|
11
- # specify { WashoutBuilder::SOAP.included_modules.should include(extension) }
12
- # end
13
- #
14
-
15
- end