Skip to content

Commit

Permalink
updated README.md by changing StaticFunction to ClassFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
Rivukis committed Dec 11, 2017
1 parent 7c5b92e commit 5a03f39
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class StringService {

// The Fake Class (If the fake is from a class then `override` will be required for each function and property)
class FakeStringService: StringService, Spryable {
enum StaticFunction: String, StringRepresentable { // <-- **REQUIRED**
enum ClassFunction: String, StringRepresentable { // <-- **REQUIRED**
case giveMeAString = "giveMeAString(arg1:arg2:)"
}

Expand Down Expand Up @@ -147,7 +147,7 @@ protocol StringService: class {
func giveMeAString() -> String
func hereAreTwoStrings(string1: String, string2: String) -> Bool
func iHaveACompletionClosure(string: String, completion: () -> Void)
static func imAStaticFunction()
static func imAClassFunction()
}

// The Real Thing can be a class
Expand All @@ -172,15 +172,15 @@ class StringService {
// do real things
}

static func imAStaticFunction() {
static func imAClassFunction() {
// do real things
}
}

// The Stub Class (If the fake is from a class then `override` will be required for each function and property)
class FakeStringService: StringService, Stubbable {
enum StaticFunction: String, StringRepresentable { // <-- **REQUIRED**
case imAStaticFunction = "imAStaticFunction()"
enum ClassFunction: String, StringRepresentable { // <-- **REQUIRED**
case imAClassFunction = "imAClassFunction()"
}

enum Function: String, StringRepresentable { // <-- **REQUIRED**
Expand Down Expand Up @@ -212,7 +212,7 @@ class FakeStringService: StringService, Stubbable {
return stubbedValue(arguments: string, completion) // <-- **REQUIRED**
}

static func imAStaticFunction() {
static func imAClassFunction() {
return stubbedValue() // <-- **REQUIRED**
}
}
Expand Down Expand Up @@ -256,7 +256,7 @@ fakeStringService.stub(.iHaveACompletionClosure).with("correct string", Argument
})

// can stub static functions as well
FakeStringService.stub(.imAStaticFunction).andReturn(Void())
FakeStringService.stub(.imAClassFunction).andReturn(Void())
```

## Spyable
Expand Down Expand Up @@ -284,7 +284,7 @@ protocol StringService: class {
var readwriteProperty: String { set get }
func giveMeAString() -> String
func hereAreTwoStrings(string1: String, string2: String) -> Bool
static func imAStaticFunction()
static func imAClassFunction()
}

// The Real Thing can be a class
Expand All @@ -305,15 +305,15 @@ class RealStringService: StringService {
return true
}

static func imAStaticFunction() {
static func imAClassFunction() {
// do real things
}
}

// The Spy Class (If the fake is from a class then `override` will be required for each function and property)
class FakeStringService: StringService, Spyable {
enum StaticFunction: String, StringRepresentable { // <-- **REQUIRED**
case imAStaticFunction = "imAStaticFunction()"
enum ClassFunction: String, StringRepresentable { // <-- **REQUIRED**
case imAClassFunction = "imAClassFunction()"
}

enum Function: String, StringRepresentable { // <-- **REQUIRED**
Expand Down Expand Up @@ -345,7 +345,7 @@ class FakeStringService: StringService, Spyable {
return false
}

static func imAStaticFunction() {
static func imAClassFunction() {
recordCall() // <-- **REQUIRED**
}
}
Expand Down

0 comments on commit 5a03f39

Please sign in to comment.