-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from vladimir-ionita/feature/gender_generator
Feature/gender generator
- Loading branch information
Showing
10 changed files
with
106 additions
and
1 deletion.
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
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
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 |
---|---|---|
|
@@ -193,6 +193,12 @@ | |
"name": [ | ||
"#{last_name} #{first_name}" | ||
] | ||
}, | ||
"gender": { | ||
"binary_type": [ | ||
"女性", | ||
"男性" | ||
] | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Foundation | ||
|
||
public final class Gender: Generator { | ||
public func type() -> String { | ||
return generate("gender.type") | ||
} | ||
|
||
public func binaryType() -> String { | ||
return generate("gender.binary_type") | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Quick | ||
import Nimble | ||
@testable import Fakery | ||
|
||
final class GenderSpec: QuickSpec { | ||
override func spec() { | ||
describe("Gender") { | ||
var gender: Gender! | ||
|
||
beforeEach { | ||
let parser = Parser(locale: "en-TEST") | ||
gender = Gender(parser: parser) | ||
} | ||
|
||
describe("#type") { | ||
it("returns the correct text") { | ||
let type = gender.type() | ||
expect(type).to(equal("Non-binary")) | ||
} | ||
} | ||
|
||
describe("#binary_type") { | ||
it("returns the correct text") { | ||
let binaryType = gender.binaryType() | ||
expect(binaryType).to(equal("Male")) | ||
} | ||
} | ||
} | ||
} | ||
} |