Skip to content

Commit

Permalink
Add colors function for vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan committed May 9, 2019
1 parent 4219618 commit 6caa058
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Fakery/Generators/Vehicle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ public final class Vehicle: Generator {
public func manufacture() -> String {
return generate("vehicle.manufacture")
}

public func make() -> String {
return generate("vehicle.makes")
}

public func colors() -> String {
return generate("vehicle.colors")
}
}
7 changes: 7 additions & 0 deletions Tests/Fakery/Generators/VehicleSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ final class VehicleSpec: QuickSpec {
expect(make).to(equal("BMW"))
}
}

describe("#colors") {
it("returns the correct color") {
let color = vehicle.colors()
expect(color).to(equal("Red"))
}
}
}
}
}

0 comments on commit 6caa058

Please sign in to comment.