Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/hams #112

Merged
merged 9 commits into from
May 9, 2019
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Fakery.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -178,6 +178,11 @@
D59B6D391D99C82E007CB072 /* NumberSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D59B6CFC1D99C5FD007CB072 /* NumberSpec.swift */; };
D59B6D3A1D99C82E007CB072 /* PhoneNumberSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D59B6CFD1D99C5FD007CB072 /* PhoneNumberSpec.swift */; };
D59B6D3B1D99C82E007CB072 /* TeamSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = D59B6CFE1D99C5FD007CB072 /* TeamSpec.swift */; };
F7A019902283206600B92D39 /* HamSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0198F22831FCB00B92D39 /* HamSpec.swift */; };
F7A019912283206600B92D39 /* HamSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0198F22831FCB00B92D39 /* HamSpec.swift */; };
F7A019932283212900B92D39 /* Ham.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A019922283212000B92D39 /* Ham.swift */; };
F7A019942283212A00B92D39 /* Ham.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A019922283212000B92D39 /* Ham.swift */; };
F7A019952283212B00B92D39 /* Ham.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A019922283212000B92D39 /* Ham.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
@@ -272,6 +277,8 @@
D59B6D131D99C6C7007CB072 /* Info-Tests-Mac.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Tests-Mac.plist"; sourceTree = "<group>"; };
D59B6D141D99C6C7007CB072 /* Info-Tests-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-Tests-tvOS.plist"; sourceTree = "<group>"; };
D59B6D151D99C6C7007CB072 /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = "<group>"; };
F7A0198F22831FCB00B92D39 /* HamSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HamSpec.swift; sourceTree = "<group>"; };
F7A019922283212000B92D39 /* Ham.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ham.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -421,6 +428,7 @@
09F65D6E1CA30351006C87C5 /* Number.swift */,
BCFFA1731BF9F912005A3BC1 /* PhoneNumber.swift */,
BCFFA1741BF9F912005A3BC1 /* Team.swift */,
F7A019922283212000B92D39 /* Ham.swift */,
1057479C1F6FBF6C00154ECB /* Bank.swift */,
AC88DC0A21531E2E007198E6 /* Date.swift */,
);
@@ -482,6 +490,7 @@
D59B6CFC1D99C5FD007CB072 /* NumberSpec.swift */,
D59B6CFD1D99C5FD007CB072 /* PhoneNumberSpec.swift */,
D59B6CFE1D99C5FD007CB072 /* TeamSpec.swift */,
F7A0198F22831FCB00B92D39 /* HamSpec.swift */,
105747991F6FBAA500154ECB /* BankSpec.swift */,
AC88DC0C215330A3007198E6 /* DateSpec.swift */,
);
@@ -879,6 +888,7 @@
BC4477941BFA451900E8FB15 /* Business.swift in Sources */,
BC4477981BFA452400E8FB15 /* Internet.swift in Sources */,
BC4477951BFA451C00E8FB15 /* Commerce.swift in Sources */,
F7A019942283212A00B92D39 /* Ham.swift in Sources */,
BC44779E1BFA453C00E8FB15 /* Parser.swift in Sources */,
BC44779A1BFA452900E8FB15 /* Name.swift in Sources */,
09F65D701CA30351006C87C5 /* Number.swift in Sources */,
@@ -913,6 +923,7 @@
D59B6D2E1D99C82E007CB072 /* ParserSpec.swift in Sources */,
D59B6D321D99C82E007CB072 /* BusinessSpec.swift in Sources */,
D59B6D3B1D99C82E007CB072 /* TeamSpec.swift in Sources */,
F7A019912283206600B92D39 /* HamSpec.swift in Sources */,
D59B6D3A1D99C82E007CB072 /* PhoneNumberSpec.swift in Sources */,
D59B6D2C1D99C82E007CB072 /* ConfigSpec.swift in Sources */,
D59B6D381D99C82E007CB072 /* NameSpec.swift in Sources */,
@@ -930,6 +941,7 @@
BCFFA1921BF9F912005A3BC1 /* Parser.swift in Sources */,
BCFFA19A1BF9F912005A3BC1 /* Company.swift in Sources */,
BCFFA1931BF9F912005A3BC1 /* Provider.swift in Sources */,
F7A019952283212B00B92D39 /* Ham.swift in Sources */,
BCFFA1911BF9F912005A3BC1 /* Config.swift in Sources */,
BCFFA19C1BF9F912005A3BC1 /* Internet.swift in Sources */,
09F65D6F1CA30351006C87C5 /* Number.swift in Sources */,
@@ -964,6 +976,7 @@
D59B6D1E1D99C82D007CB072 /* ParserSpec.swift in Sources */,
D59B6D221D99C82D007CB072 /* BusinessSpec.swift in Sources */,
D59B6D2B1D99C82D007CB072 /* TeamSpec.swift in Sources */,
F7A019902283206600B92D39 /* HamSpec.swift in Sources */,
D59B6D2A1D99C82D007CB072 /* PhoneNumberSpec.swift in Sources */,
D59B6D1C1D99C82D007CB072 /* ConfigSpec.swift in Sources */,
D59B6D281D99C82D007CB072 /* NameSpec.swift in Sources */,
@@ -981,6 +994,7 @@
D59B6CA11D99C45D007CB072 /* Parser.swift in Sources */,
D59B6CA91D99C46C007CB072 /* Company.swift in Sources */,
D59B6CAE1D99C46C007CB072 /* Number.swift in Sources */,
F7A019932283212900B92D39 /* Ham.swift in Sources */,
D59B6CA21D99C460007CB072 /* Provider.swift in Sources */,
D59B6CA01D99C45A007CB072 /* Config.swift in Sources */,
D59B6CB01D99C46C007CB072 /* Team.swift in Sources */,
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ It's useful in all the cases when you need to use some dummy data for testing, p
* [Phone number](#phone-number)
* [Team](#team)
* [Bank](#bank)
* [Ham](#ham)
* [Installation](#installation)
* [Contributing](#contributing)
* [Author](#author)
@@ -212,6 +213,13 @@ faker.bank.iban() // => "NL45BUNQ2209931378"
faker.bank.bban() //=> ABNA0136468471
```

### Ham

```swift

faker.ham.name() //=> "Taylor Ham"
```

## Installation

**Fakery** is available through [CocoaPods](http://cocoapods.org). To install
3 changes: 3 additions & 0 deletions Resources/Locales/en-TEST.json
Original file line number Diff line number Diff line change
@@ -118,6 +118,9 @@
"ibanLetterCode": ["????"],
"ibanDigits": ["############"],
}
},
"ham": {
"name": ["Smithfield Ham"]
}
}
}
14 changes: 14 additions & 0 deletions Resources/Locales/en.json
Original file line number Diff line number Diff line change
@@ -9855,6 +9855,20 @@
"#{Name.name}",
"#{Company.name}"
]
},
"ham": {
"name": [
"Country Ham",
"Virginia Ham",
"Smithfield Ham",
"Taylor Ham",
"City Ham",
"Ham Steak",
"Spiral-Cut Ham",
"Black Forest Ham",
"Canned Ham",
"Pressed Ham"
]
}
}
}
5 changes: 5 additions & 0 deletions Sources/Fakery/Generators/Ham.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public final class Ham: Generator {
public func name() -> String {
return generate("ham.name")
}
}
23 changes: 23 additions & 0 deletions Tests/Fakery/Generators/HamSpec.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Quick
import Nimble
@testable import Fakery

final class HamSpec: QuickSpec {
override func spec() {
describe("Ham") {
var ham: Ham!

beforeEach {
let parser = Parser(locale: "en-TEST")
ham = Ham(parser: parser)
}

describe("#name") {
it("returns the correct text") {
let name = ham.name()
expect(name).to(equal("Smithfield Ham"))
}
}
}
}
}