Merge pull request #3258 from wing328/ruby_fix_test_case

[Ruby] minor update to ruby test cases
This commit is contained in:
wing328
2016-06-30 16:48:35 +08:00
committed by GitHub

View File

@@ -28,10 +28,11 @@ require 'date'
describe 'test attribute "{{{name}}}"' do
it 'should work' do
{{#isEnum}}
validator = Petstore::EnumTest::EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}])
validator.allowable_values.each do |value|
expect { @instance.{{name}} = value }.not_to raise_error
end
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
#validator = Petstore::EnumTest::EnumAttributeValidator.new('{{{datatype}}}', [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}])
#validator.allowable_values.each do |value|
# expect { @instance.{{name}} = value }.not_to raise_error
#end
{{/isEnum}}
{{^isEnum}}
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers