exe/soaspec in soaspec-0.1.18 vs exe/soaspec in soaspec-0.2.0
- old
+ new
@@ -16,14 +16,14 @@
long_desc <<-LONGDESC
`soaspec new` will generate the initial files and folders for starting a testing project using soaspec
\x5
- `soaspec new soap` will create example files testing against a virtual SOAP service
+ `soaspec new soap` will create example files testing against a SOAP service
\x5
- `soaspec new rest` will create example files testing against a virtual REST service
+ `soaspec new rest` will create example files testing against a REST service
LONGDESC
desc 'new [type]', 'Initialize soaspec repository'
option :ci, default: 'jenkins', banner: 'What Continuous Integration is used'
option :virtual, type: :boolean, default: true, banner: 'Whether to set things up for a virtual server'
def new(type = 'initial')
@@ -41,16 +41,31 @@
create_file(filename: 'spec/spec_helper.rb')
puts "Run 'bundle install' to install necessary gems"
puts "Run 'rake spec' to run the tests"
end
+ long_desc <<-LONGDESC
+ `soaspec add rest` will generate the initial files and folders for starting a testing project using soaspec
+ \x5
+
+ `soaspec add soap` will create example files testing against a virtual SOAP service
+ \x5
+
+ LONGDESC
+ desc 'add [type] [name]', 'Add new ExchangeHandler'
+ def add(type = 'rest', name = 'TestService')
+ raise "Type '#{type}' is not available" unless %w[rest soap].include? type
+ @name = name # Use instance variable for ERB
+ create_file(filename: File.join('lib', "#{name.snakecase}.rb"), content: retrieve_contents("lib/new_#{type}_service.rb"))
+ end
+
desc 'generate', 'Generate initial test code from wsdl'
long_desc <<-LONGDESC
`soaspec generate wsdl=wsdl name=ServiceName ` will generate the initial files and folders to test each operation in a wsdl
\x5
Additionally the auth parameter can be used to use basic authentication to retrieve the WSDL.
To do use the following `soaspec generate --auth=basic`
-
+ Note: This is still a work in progress and will only work for a very simple wsdl
LONGDESC
option :wsdl, required: true, aliases: :w
option :name, default: 'Service', aliases: :n
option :ci, default: 'jenkins', banner: 'What Continuous Integration is used'
option :auth
\ No newline at end of file