37bb654424
Change-Id: Id124ec4c598c7b6bcb7c8134d75825fd01d938d2
23 lines
592 B
Ruby
23 lines
592 B
Ruby
require 'spec_helper'
|
|
|
|
describe 'convert_to_json_string' do
|
|
it 'exists' do
|
|
is_expected.not_to eq(nil)
|
|
end
|
|
|
|
it 'hash to json string' do
|
|
data = {:some => "data"}
|
|
is_expected.to run.with_params(data).and_return('{"some":"data"}')
|
|
end
|
|
|
|
it 'array of strings with kv to json string' do
|
|
data = ['mykey:myvalue', 'key2:val2']
|
|
is_expected.to run.with_params(data).and_return('{"mykey":"myvalue","key2":"val2"}')
|
|
end
|
|
|
|
it 'array of strings to json strings' do
|
|
data = ['val1', 'val2']
|
|
is_expected.to run.with_params(data).and_return('["val1","val2"]')
|
|
end
|
|
end
|