-
- it "should swapcase a string" do
- result = scope.function_swapcase(["aaBBccDD"])
- expect(result).to(eq('AAbbCCdd'))
+ describe 'with arrays as inputs' do
+ it { is_expected.to run.with_params([]).and_return([]) }
+ describe 'only containing strings' do
+ it { is_expected.to run.with_params(['']).and_return(['']) }
+ it { is_expected.to run.with_params(['one']).and_return(['ONE']) }
+ it { is_expected.to run.with_params(['ONE']).and_return(['one']) }
+ it { is_expected.to run.with_params(['oNe']).and_return(['OnE']) }
+ it { is_expected.to run.with_params(['one', 'ONE']).and_return(['ONE', 'one']) }
+ it { is_expected.to run.with_params(['ONE', 'OnE']).and_return(['one', 'oNe']) }
+ it { is_expected.to run.with_params(['oNe', 'one']).and_return(['OnE', 'ONE']) }
+ end
+ describe 'containing mixed types' do
+ it { is_expected.to run.with_params(['OnE', {}]).and_return(['oNe', {}]) }
+ it { is_expected.to run.with_params(['OnE', 1]).and_return(['oNe', 1]) }
+ it { is_expected.to run.with_params(['OnE', []]).and_return(['oNe', []]) }
+ it { is_expected.to run.with_params(['OnE', ['two']]).and_return(['oNe', ['two']]) }
+ end