Sha256: a3431a9db6c7e2070e7a4975cd1d2d7031129dfb7e099ff5350ca8f321b62a9b

Contents?: true

Size: 1.66 KB

Versions: 1

Compression:

Stored size: 1.66 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe "Ryba" do
  describe "Name" do
    before :all do
      @name = Ryba::Name
    end

    it "should work for male" do
      @name.first_name(true)
      @name.middle_name(true)
      @name.family_name(true)
      @name.full_name(true)
    end
    
    it "should work for female" do
      @name.first_name(false)
      @name.middle_name(false)
      @name.family_name(false)
      @name.full_name(false)
    end

    it "should work with random gender" do
      @name.gender do |gender|
        @name.first_name(gender)
        @name.middle_name(gender)
        @name.family_name(gender)
        @name.full_name(gender)
      end
    end
  end

  describe "PhoneNumber" do
    before :all do
      @pn = Ryba::PhoneNumber
    end

    it "should work" do
      20.times do
        @pn.phone_number.should match(/\d/)
      end
    end
  end

  describe "Address" do
    before :all do
      @adr = Ryba::Address
    end

    it "#index should be integer" do
      20.times do
        @adr.index.should be_kind_of(Integer)
      end
    end

    [:city, :full_city, :street, :address, :postal].each do |meth|
      it "##{meth} should return not empty string" do
        20.times do
          str = @adr.send(meth)
          str.should be_kind_of(String)
          str.should_not be_empty
        end
      end
    end
  end

  describe "Company" do
    it "#name should work" do
      20.times do
        n = Ryba::Company.name
        n.should_not be_empty
      end
    end

    it "#name with options should work" do
      20.times do
        n = Ryba::Company.name(:solidity => 3)
        n.should_not be_empty
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ryba-0.1.1 spec/ryba_spec.rb