Topic: Rspecs with method and shoulda

This should be pretty simple to get a method working in a shoulda command right?

Can someone please let me everything wrong with this code?? I come from a C#/Java background

describe TnCustomer do
  describe "TnCustomer " do
    it 'TnCustomerid should be 10 characters long' do                  should allow_value(generate_id(two_letter-prefix,10).for(:TnCustomer ) end
   
  def generate_id(two_letter_prefix, length_of_id)
    begin
      str = "1" * (length_of_id - 2)
    end
      two_letter_prefix = two_letter_prefix + str
      str
  end

Last edited by IcedBoots (2013-05-05 20:57:17)