Skip to content

Commit

Permalink
Merge pull request #1 from devandanger/master
Browse files Browse the repository at this point in the history
Updates for Xcode 12
  • Loading branch information
q231950 authored Nov 14, 2020
2 parents bd9b178 + 298a6b2 commit 0fe1b7a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Sources/Rorschach/Builders/TestBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import Foundation

@_functionBuilder public struct TestBuilder<C> {

static public func buildBlock(_ given: Given<C>, _ when: When<C>, _ then: Then<C>) -> (Given<C>, When<C>, Then<C>) {
public static func buildBlock(_ given: Given<C>, _ when: When<C>, _ then: Then<C>) -> (Given<C>, When<C>, Then<C>) {
return (given, when, then)
}

static public func buildBlock(_ when: When<C>, _ then: Then<C>) -> (When<C>, Then<C>) {
public static func buildBlock(_ when: When<C>, _ then: Then<C>) -> (When<C>, Then<C>) {
return (when, then)
}
}
5 changes: 2 additions & 3 deletions Sources/Rorschach/Builders/ThenBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import Foundation


@_functionBuilder struct ThenBuilder<C> {

static func buildBlock(_ assertion: Assertion<C>) -> Assertion<C> {
@_functionBuilder public struct ThenBuilder<C> {
public static func buildBlock(_ assertion: Assertion<C>) -> Assertion<C> {
assertion
}
}
12 changes: 7 additions & 5 deletions Sources/Rorschach/When.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ import XCTest

public struct When<C> {

let step: Step<C>
let steps: [Step<C>]

public init(@WhenBuilder<C> _ content: () -> Step<C>) {
step = content()
public init(@WhenBuilder<C> _ content: () -> [Step<C>]) {
steps = content()
}

func execute(in context: inout C) {
XCTContext.runActivity(named: step.title) { activity in
step.execute(in: &context)
steps.forEach { step in
XCTContext.runActivity(named: step.title ) { _ in
step.execute(in: &context)
}
}
}
}
Expand Down

0 comments on commit 0fe1b7a

Please sign in to comment.