Giter Site home page Giter Site logo

tomharris / random_data Goto Github PK

View Code? Open in Web Editor NEW
87.0 87.0 28.0 135 KB

Provides methods for generating random test data including names, mailing addresses, dates, phone numbers, e-mail addresses, and text. Now, ruby 1.9 compatible.

License: MIT License

Ruby 100.00%

random_data's People

Contributors

tomharris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

random_data's Issues

Random.state private

When trying to use Random.state I get an exception saying 'attempted to access private method 'Random.state'

def fake_members
    if Member.count < 5
      start = 0
      max = 24

      while start < max
        member = Member.new(first_name: Random.firstname, last_name: Random.lastname, address: Random.address_line_1,
                            city: Random.city, state:  Random.state , zipcode: Random.zipcode, phone_number: Random.phone,
                            email: Random.email)
        member.save
        start += 1
      end
    end
  end

randon_data

Hi Mike,

I came across your git : https://github.com/tomharris/random_data as i was searching the internet for how calabash-ios generate random texts or data and i found yours.

I have installed the gem in my automation framework please how can i apply this in my calabash step definition?
I will have to fill registration forms in my automation test and i have to fill in random text everytime i run the test.

Please kindly help me out.

Thanks
Lummy Johnson

undefined method `companyname' for Random:Class

When trying to generate a company name i get this issue.

undefined method `companyname' for Random:Class

The same happens when trying to use company_name

def fake_vendors
    if !Vendor.any?
      start = 0
      stop = 9
      while start < stop
        vendor = Vendor.new( name: Random.companyname,
                            address: Random.address_line_1,
                            city: Random.city,
                            state: Random.state,
                            phone_number: Random.phone,
                            email: Random.email,
                            zipcode: Random.zipcode)
        vendor.save
        start +=1
      end
    end
  end

Random.phone sometimes generates an extra digit at the end of the phone number

For example, see the following output:

irb(main):024:0> Random.phone
=> "235-306-5221"
irb(main):025:0> Random.phone
=> "924-824-7990"
irb(main):026:0> Random.phone
=> "396-991-3759"
irb(main):027:0> Random.phone
=> "738-483-5420"
irb(main):028:0> Random.phone
=> "735-520-8574"
irb(main):029:0> Random.phone
=> "856-690-3655"
irb(main):030:0> Random.phone
=> "480-373-1639"
irb(main):031:0> Random.phone
=> "152-216-7767"
irb(main):032:0> Random.phone
=> "278-245-7239"
irb(main):033:0> Random.phone
=> "631-627-10576"

Something is strange with the gem at rubygems.org

When I install the random_data gem with Bundler fresh from RubyGems.org under Ruby 1.9.2 I get the following error:
random_data-1.5.1/lib/random_data/locations.rb:97: invalid multibyte char (US-ASCII)

This issue has been resolved on 2009-06-27 with the following commit: http://github.com/tomharris/random_data/commit/db0d1ade1f095d41b3f8449c7dcc83a45a80d874

However, when I look directly at location.rb, there is no encoding header at the top of the file.

Random_data version 1.5.1 was released on 2010-01-18, so the commit that fixes the problem should be included within this gem, but it is not!

Can you please push an actual version to rubygems with the correct encoding header in location.rb?

Thank you for this great gem.
Michael

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.