{"id":19313637,"url":"https://github.com/geektree0101/rxbdd","last_synced_at":"2026-05-12T23:06:45.638Z","repository":{"id":62453085,"uuid":"186582317","full_name":"GeekTree0101/RxBDD","owner":"GeekTree0101","description":"RxSwift \u0026 RxCocoa Behavior Driven Development Unit Test (iOS only)","archived":false,"fork":false,"pushed_at":"2019-05-16T01:28:10.000Z","size":76,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T04:02:49.598Z","etag":null,"topics":["bdd","behavior-driven-development","ios","rxcocoa","rxswift","testing"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeekTree0101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-14T08:46:46.000Z","updated_at":"2019-05-16T01:02:23.000Z","dependencies_parsed_at":"2022-11-01T23:46:12.317Z","dependency_job_id":null,"html_url":"https://github.com/GeekTree0101/RxBDD","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FRxBDD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FRxBDD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FRxBDD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekTree0101%2FRxBDD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeekTree0101","download_url":"https://codeload.github.com/GeekTree0101/RxBDD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240415272,"owners_count":19797603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdd","behavior-driven-development","ios","rxcocoa","rxswift","testing"],"created_at":"2024-11-10T00:40:31.800Z","updated_at":"2025-11-15T05:07:51.869Z","avatar_url":"https://github.com/GeekTree0101.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/GeekTree0101/RxBDD/blob/master/resources/logo.png\" /\u003e\n\n![CI Status](https://travis-ci.com/GeekTree0101/RxBDD.svg?branch=master)\n[![Version](https://img.shields.io/cocoapods/v/RxBDD.svg?style=flat)](https://cocoapods.org/pods/RxBDD)\n[![License](https://img.shields.io/cocoapods/l/RxBDD.svg?style=flat)](https://cocoapods.org/pods/RxBDD)\n[![Platform](https://img.shields.io/cocoapods/p/RxBDD.svg?style=flat)](https://cocoapods.org/pods/RxBDD)\n\n## Example\n\n\u003e Basic Usege\n```swift\nRxBDD.init(inputObservable: #INPUT_OBSERVABLETYPE, // Relay or Subject\n            outputType: #EXPECTED_OUTPUT_TYPE)\n      .given(#INPUT_EVENTS) // [Recorded\u003cEvent\u003c#INPUT_OBSERVABLETYPE_ELEMENT\u003e\u003e]\n      .when(#OUTPUT_OBSERVABLE) // Observable\u003c#EXPECTED_OUTPUT_TYPE\u003e\n      .then({ outputs in\n           XCTAssertEqual(outputs,\n                          #EXPECTED_EVENTS) // [Recorded\u003cEvent\u003c#EXPECTED_OUTPUT_TYPE\u003e\u003e]\n      })\n```\n\n\u003e Share given events\n```swift\nlet shared = RxBDD.init(inputObservable: #INPUT_OBSERVABLETYPE, // Relay or Subject\n            outputType: #EXPECTED_OUTPUT_TYPE)\n      .given(#INPUT_EVENTS) // [Recorded\u003cEvent\u003c#INPUT_OBSERVABLETYPE_ELEMENT\u003e\u003e]\n      .share()\n      \nshared.when(#OUTPUT_OBSERVABLE) // Observable\u003c#EXPECTED_OUTPUT_TYPE\u003e\n      .then({ outputs in\n           XCTAssertEqual(outputs,\n                          #EXPECTED_EVENTS) // [Recorded\u003cEvent\u003c#EXPECTED_OUTPUT_TYPE\u003e\u003e]\n      })\n      \nshared.when(#OUTPUT_OBSERVABLE) // Observable\u003c#EXPECTED_OUTPUT_TYPE\u003e\n      .then({ outputs in\n           XCTAssertEqual(outputs,\n                          #EXPECTED_EVENTS) // [Recorded\u003cEvent\u003c#EXPECTED_OUTPUT_TYPE\u003e\u003e]\n      })\n```\n\n\u003e Description\n```swift\n    func testMultiplyWithRxBDD() {\n        let integerInput = PublishSubject\u003cInt\u003e.init()\n        let multiplyOutput: Observable\u003cInt\u003e = input.map({ $0 * $0 }).asObservable()\n        \n        let test = RxBDD.init(inputObservable: integerInput,\n                              outputType: Int.self)\n                   \n        // Given: I have 10, 20, 30 Integer input events\n        test.given([.next(100, 10),\n                    .next(200, 20),\n                    .next(300, 30)])  \n                    \n        // When: It should multiply input integer events\n        test.when(output)\n        \n        // Then: It should have multiplied integer events\n        test.then({ outputs in\n                XCTAssertEqual(outputs,\n                               [.next(100, 100),\n                                .next(200, 400),\n                                .next(300, 900)])\n            })\n    }\n```\n\n\n\n[More See](https://github.com/GeekTree0101/RxBDD/blob/master/Example/Tests/RxBDDTests.swift)\n\n\n## Requirements\n- Xcode, ~\u003e 10.x\n- Swift, 4.2 // 5.0 coming soon!\n- RxSwift, ~\u003e 4.0\n- RxCocoa, ~\u003e 4.0\n- RxTest, ~\u003e 4.0\n\n## Installation\n\nRxBDD is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\ntarget 'YOUR_PROJECT_Example' do\n\n  target 'YOUR_PROJECT_Tests' do\n    pod 'RxBDD'\n  end\nend\n```\n\n## Author\n\nGeektree0101, h2s1880@gmail.com\n\n## License\n\nRxBDD is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektree0101%2Frxbdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeektree0101%2Frxbdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeektree0101%2Frxbdd/lists"}