-
- it "should raise a TypeError if the second argument is an array" do
- expect { scope.function_join_keys_to_values([{}, [1,2]]) }.to raise_error TypeError
- end
-
- it "should raise a TypeError if the second argument is a number" do
- expect { scope.function_join_keys_to_values([{}, 1]) }.to raise_error TypeError
- end
-
- it "should return an empty array given an empty hash" do
- result = scope.function_join_keys_to_values([{}, ":"])
- expect(result).to eq([])
- end
-
- it "should join hash's keys to its values" do
- result = scope.function_join_keys_to_values([{'a'=>1,2=>'foo',:b=>nil}, ":"])
- expect(result).to match_array(['a:1','2:foo','b:'])
+ it 'should run join_keys_to_values(<hash with array value>, " ") and return the proper array' do
+ result = subject.call([{ 'key1' => 'value1', 'key2' => ['value2', 'value3'] }, ' '])
+ expect(result.sort).to eq(['key1 value1', 'key2 value2', 'key2 value3'].sort)