-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,36 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb') | ||
|
||
class TestFakerHacker < Test::Unit::TestCase | ||
class TestFakerHacker < Test::Unit::TestCase | ||
def setup | ||
@hacker = Faker::Hacker | ||
@phrases = @hacker.phrases | ||
@phrases = @hacker.phrases | ||
end | ||
def test_phrases | ||
assert @phrases.size == 8 | ||
|
||
def test_phrases | ||
assert @phrases.size == 8 | ||
@phrases.each do |phrase| | ||
assert !phrase.nil? | ||
assert phrase != "" | ||
end | ||
end | ||
|
||
def test_noun | ||
refute phrase.to_s.empty? | ||
end | ||
end | ||
|
||
def test_noun | ||
assert @hacker.noun.match(/\w+/) | ||
end | ||
|
||
def test_abbreviation | ||
assert @hacker.abbreviation.match(/\w+/) | ||
end | ||
|
||
def test_adjective | ||
assert @hacker.adjective.match(/\w+/) | ||
end | ||
|
||
def test_verb | ||
assert @hacker.verb.match(/\w+/) | ||
end | ||
|
||
def test_ingverb | ||
assert @hacker.ingverb.match(/\w+/) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,49 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb') | ||
|
||
class TestFakerShakespeare < Test::Unit::TestCase | ||
class TestFakerShakespeare < Test::Unit::TestCase | ||
def setup | ||
@romeo_and_juliet = Faker::Shakespeare.romeo_and_juliet | ||
@king_richard_iii = Faker::Shakespeare.king_richard_iii | ||
@as_you_like_it = Faker::Shakespeare.as_you_like_it | ||
@hamlet = Faker::Shakespeare.hamlet | ||
end | ||
|
||
def test_quotes | ||
assert @romeo_and_juliet.size == 11 | ||
@romeo_and_juliet.each do |quotes| | ||
assert !quotes.nil? | ||
assert quotes != "" | ||
end | ||
|
||
assert @king_richard_iii.size == 8 | ||
@king_richard_iii.each do |quotes| | ||
assert !quotes.nil? | ||
assert quotes != "" | ||
end | ||
|
||
assert @as_you_like_it.size == 8 | ||
@as_you_like_it.each do |quotes| | ||
assert !quotes.nil? | ||
assert quotes != "" | ||
end | ||
|
||
assert @hamlet.size == 18 | ||
@hamlet.each do |quotes| | ||
assert !quotes.nil? | ||
assert quotes != "" | ||
end | ||
end | ||
|
||
assert @romeo_and_juliet.size == 11 | ||
@romeo_and_juliet.each do |quote| | ||
refute quote.to_s.empty? | ||
end | ||
|
||
assert @king_richard_iii.size == 8 | ||
@king_richard_iii.each do |quote| | ||
refute quote.to_s.empty? | ||
end | ||
|
||
assert @as_you_like_it.size == 8 | ||
@as_you_like_it.each do |quote| | ||
refute quote.to_s.empty? | ||
end | ||
|
||
assert @hamlet.size == 18 | ||
@hamlet.each do |quote| | ||
refute quote.to_s.empty? | ||
end | ||
end | ||
|
||
def test_as_you_like_it_quote | ||
assert Faker::Shakespeare.as_you_like_it_quote.match(/\w+/) | ||
end | ||
|
||
def test_king_richard_iii_quote | ||
assert Faker::Shakespeare.king_richard_iii_quote.match(/\w+/) | ||
end | ||
|
||
def test_romeo_and_juliet_quote | ||
assert Faker::Shakespeare.romeo_and_juliet_quote.match(/\w+/) | ||
end | ||
|
||
def test_hamlet_quote | ||
assert Faker::Shakespeare.hamlet_quote.match(/\w+/) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters