iPhoneAddict Apps
  • Actualités
  • Accueil Apps
  • iPhone
  • iPad
  • Universelles
  • Mac
  • Apple TV
KG KultureGeek
App
iPhone / iPad Télécharger iAddict v5 Mac Télécharger iAddict Mac
  • Actualités
  • Accueil Apps
  • iPhone
  • iPad
  • Universelles
  • Mac
  • Apple TV
  • Archives keynotes
  • Firmwares & iTunes
  • Contactez-nous
  • Comparateur de prix
  • KultureGeek
Accueil » Liste des Apps » Apps Mac » developpeurs » Rubicon
3.0.0 macOS €Gratuit Avenga Czechia s.r.o 0 0 Swift parser + mock generator + Xcode extension https://github.com/raptorxcz/Rubicon Rubicon generates spys, stub, mocks and dummies for protocols. Generating methods for parent protocol is not supported. example: input: protocol Car { var...
Rubicon

Rubicon

macOS / developpeurs

Gratuit
Obtenir sur l'App Store
Facebook X E-mail

Swift parser + mock generator + Xcode extension
https://github.com/raptorxcz/Rubicon

Rubicon generates spys, stub, mocks and dummies for protocols. Generating methods for parent protocol is not supported.

example:

input:

protocol Car {
var name: String? { get }
var color: Int { get set }

@MainActor
func go()
func load(with stuff: Int, label: String) throws -> Int
func isFull() -> Bool
func download() async throws -> [String]
}

output:

spy:

final class CarSpy: Car {
struct Load {
let stuff: Int
let label: String
}

var name: String?
var color: Int
var loadThrowBlock: () -> Void?
var loadReturn: Int
var isFullReturn: Bool
var downloadThrowBlock: () -> Void?
var downloadReturn: [String]

var goCount = 0
var load = [Load]()
var isFullCount = 0
var downloadCount = 0

init(color: Int, loadReturn: Int, isFullReturn: Bool, downloadReturn: [String]) {
self.color = color
self.loadReturn = loadReturn
self.isFullReturn = isFullReturn
self.downloadReturn = downloadReturn
}

func go() {
goCount += 1
}

func load(with stuff: Int, label: String) throws -> Int {
let item = Load(stuff: stuff, label: label)
load.append(item)
try loadThrowBlock?()
return loadReturn
}

func isFull() -> Bool {
isFullCount += 1
return isFullReturn
}

func download() async throws -> [String] {
downloadCount += 1
try downloadThrowBlock?()
return downloadReturn
}
}

stub:

final class CarStub: Car {
var name: String?
var color: Int
var loadThrowBlock: () -> Void?
var loadReturn: Int
var isFullReturn: Bool
var downloadThrowBlock: () -> Void?
var downloadReturn: [String]

init(color: Int, loadReturn: Int, isFullReturn: Bool, downloadReturn: [String]) {
self.color = color
self.loadReturn = loadReturn
self.isFullReturn = isFullReturn
self.downloadReturn = downloadReturn
}

func go() {
}

func load(with stuff: Int, label: String) throws -> Int {
try loadThrowBlock?()
return loadReturn
}

func isFull() -> Bool {
return isFullReturn
}

func download() async throws -> [String] {
try downloadThrowBlock?()
return downloadReturn
}
}

dummy:

final class CarDummy: Car {
var name: String? {
get {
fatalError()
}
}
var color: Int {
get {
fatalError()
}
set {
fatalError()
}
}

func go() {
fatalError()
}

func load(with stuff: Int, label: String) throws -> Int {
fatalError()
}

func isFull() -> Bool {
fatalError()
}

func download() async throws -> [String] {
fatalError()
}
}

usage in tests:

let carSpy = CarSpy()

...

let a1 = carSpy.goCount == 1
let a2 = carSpy.load.count == 1
let a3 = carSpy.load[0].stuff == 2
let a4 = carSpy.load[0].label == "name"

https://github.com/raptorxcz/Rubicon

Xcode extension

Xcode extension can generate test doubles for all or just selected protocols in the current file. The resulting test double can be written to the source file or pasteboard.

En voir plus...

Quoi de neuf dans la dernière version ?

Migrated to Swift Syntax, which fixed many bungs.

  • Screenshot #1 pour Rubicon
  • Screenshot #2 pour Rubicon
  • Screenshot #3 pour Rubicon

D'autres applications du développeur

Chamberlain - FM&SChamberlain - FM&SiPhone

Note

(0 note)

Détails sur l'application

Version
3.0.0
Taille
9.7 Mo
Version minimum de macOS
13.3
Dernière mise à jour
22/09/2023
Publié par
Avenga Czechia s.r.o

Newsletter App Store

Recevez chaque jour les meilleures promos

Actualité Apple

Image Apple limite les signalements de failles face au déluge de l’IA
Apple limite les signalements de failles face au déluge de l’IA
Image iPad Air 2027 : écran OLED, puce M5 et possible nouveau design
iPad Air 2027 : écran OLED, puce M5 et possible nouveau design
Image iPhone : Apple a capté 49 % des revenus de smartphones au 2e trimestre, un record
iPhone : Apple a capté 49 % des revenus de smartphones au 2e trimestre, un record
Image L’iPhone Air 2 aurait une Dynamic Island plus petite et d’autres nouveautés
L’iPhone Air 2 aurait une Dynamic Island plus petite et d’autres nouveautés
iPhoneAddict Apps

Le catalogue iPhoneAddict pour suivre les nouveautés, mises à jour et baisses de prix de l’App Store.

Apps

Toutes les apps iOS iPhone iPad Universelles Mac Apple TV

iPhoneAddict

Actualité Apple Archives keynotes Contact À propos KultureGeek

Suivez-nous

©2009-2026 i2CMedia. Tous droits réservés.