babynames 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,30 @@
1
1
  require 'helper'
2
2
 
3
3
  class TestBabynames < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
4
+ should "return a random name" do
5
+ name = BabyNames.name
6
+ assert name.size > 0
7
+ assert name.is_a? String
8
+ end
9
+
10
+ should "return an array of names" do
11
+ [:names, :female_names, :male_names].each do |method|
12
+ names = BabyNames.send(method)
13
+ assert names.size > 500
14
+ assert names.collect{|n| n.size > 0 && n.is_a?(String)}
15
+ end
16
+ end
17
+
18
+ should "seed the sequence" do
19
+ seed = BabyNames.seed
20
+ names = []
21
+ 1.upto(3).each do
22
+ names << BabyNames.name
23
+ end
24
+
25
+ BabyNames.seed(seed)
26
+ names.each do |name|
27
+ assert BabyNames.name == name
28
+ end
6
29
  end
7
30
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babynames
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordan Carter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-10 00:00:00 +12:00
18
+ date: 2011-06-11 00:00:00 +12:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -95,7 +95,10 @@ files:
95
95
  - README.rdoc
96
96
  - Rakefile
97
97
  - VERSION
98
+ - babynames.gemspec
98
99
  - lib/babynames.rb
100
+ - lib/data/female_names.txt
101
+ - lib/data/male_names.txt
99
102
  - test/helper.rb
100
103
  - test/test_babynames.rb
101
104
  has_rdoc: true