diff --git a/lib/stackup/parameters.rb b/lib/stackup/parameters.rb index 5071425..4c722ef 100644 --- a/lib/stackup/parameters.rb +++ b/lib/stackup/parameters.rb @@ -45,7 +45,7 @@ def to_a if value == :use_previous_value record[:use_previous_value] = true else - record[:parameter_value] = value + record[:parameter_value] = value.to_s end end end @@ -75,7 +75,7 @@ def value if use_previous_value :use_previous_value else - parameter_value + parameter_value.to_s end end diff --git a/spec/stackup/parameters_spec.rb b/spec/stackup/parameters_spec.rb index 06267a4..248c12c 100644 --- a/spec/stackup/parameters_spec.rb +++ b/spec/stackup/parameters_spec.rb @@ -146,6 +146,30 @@ end + context "with Integer values" do + + let(:input_records) do + [{ :parameter_key => "SomeInteger", :parameter_value => 123456789 }] + end + + subject(:parameters) { Stackup::Parameters.new(input_records) } + + describe "#to_hash" do + it "converts the Integer to a String" do + expected = { "SomeInteger" => "123456789" } + expect(parameters.to_hash).to eql(expected) + end + end + + describe "#to_a" do + it "converts the Integer to a String" do + expected = [{ :parameter_key => "SomeInteger", :parameter_value => "123456789" }] + expect(parameters.to_a).to eql(expected) + end + end + + end + context "with empty parameter file" do let(:input_records) { false }