Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

refactor duplicate tests rspec

describe '#double_it' do
  def self.test_double_it(initial, doubled)
    it "doubles #{initial} into #{doubled}" do
      expect(double_it(initial)).to eq(doubled)
    end
  end

  test_double_it 1, 2
  test_double_it 2, 4
  test_double_it 4, 8
end
Source by www.rubysteps.com #
 
PREVIOUS NEXT
Tagged: #refactor #duplicate #tests #rspec
ADD COMMENT
Topic
Name
7+3 =