From 073ee035d8dae23a757295962d7007ae4292d83a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eimantas=20Vaic=CC=8Ciu=CC=84nas?= Date: Thu, 12 Sep 2019 13:38:47 +0300 Subject: [PATCH] Release commit --- NimbleFeedback.xcodeproj/project.pbxproj | 163 ++++++++++++++++++ .../xcschemes/NimbleFeedback.xcscheme | 111 ++++++++++++ NimbleFeedbackTests/DummyState.swift | 27 +++ NimbleFeedbackTests/DummyStateTests.swift | 33 ++++ NimbleFeedbackTests/Info.plist | 22 +++ NimbleFeedbackTests/NimbleFeedbackTests.swift | 21 +++ 6 files changed, 377 insertions(+) create mode 100644 NimbleFeedback.xcodeproj/xcshareddata/xcschemes/NimbleFeedback.xcscheme create mode 100644 NimbleFeedbackTests/DummyState.swift create mode 100644 NimbleFeedbackTests/DummyStateTests.swift create mode 100644 NimbleFeedbackTests/Info.plist create mode 100644 NimbleFeedbackTests/NimbleFeedbackTests.swift diff --git a/NimbleFeedback.xcodeproj/project.pbxproj b/NimbleFeedback.xcodeproj/project.pbxproj index 182aa2b..106bcf6 100644 --- a/NimbleFeedback.xcodeproj/project.pbxproj +++ b/NimbleFeedback.xcodeproj/project.pbxproj @@ -10,14 +10,51 @@ 53121D4323042AE100148925 /* NimbleFeedback.h in Headers */ = {isa = PBXBuildFile; fileRef = 53121D4123042AE100148925 /* NimbleFeedback.h */; settings = {ATTRIBUTES = (Public, ); }; }; 53121D4A23042B2100148925 /* NimbleFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53121D4923042B2100148925 /* NimbleFeedback.swift */; }; 53121E3123042C8800148925 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53121E1A23042C6400148925 /* Nimble.framework */; }; + 53121E39230431C500148925 /* NimbleFeedbackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53121E38230431C500148925 /* NimbleFeedbackTests.swift */; }; + 53121E3B230431C500148925 /* NimbleFeedback.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53121D3E23042AE100148925 /* NimbleFeedback.framework */; }; + 53121E422304330C00148925 /* Nimble.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 53121E1A23042C6400148925 /* Nimble.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 53121E432304330C00148925 /* NimbleFeedback.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 53121D3E23042AE100148925 /* NimbleFeedback.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 53121E452304332300148925 /* DummyState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53121E442304332300148925 /* DummyState.swift */; }; + 538D47C82304494400F356B0 /* DummyStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538D47C72304494400F356B0 /* DummyStateTests.swift */; }; + 538D47C923044A2900F356B0 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53121E1A23042C6400148925 /* Nimble.framework */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 53121E3C230431C500148925 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 53121D3523042AE100148925 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 53121D3D23042AE100148925; + remoteInfo = NimbleFeedback; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 53121E412304330100148925 /* Copy Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 53121E422304330C00148925 /* Nimble.framework in Copy Frameworks */, + 53121E432304330C00148925 /* NimbleFeedback.framework in Copy Frameworks */, + ); + name = "Copy Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 53121D3E23042AE100148925 /* NimbleFeedback.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NimbleFeedback.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 53121D4123042AE100148925 /* NimbleFeedback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NimbleFeedback.h; sourceTree = ""; }; 53121D4223042AE100148925 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53121D4923042B2100148925 /* NimbleFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NimbleFeedback.swift; sourceTree = ""; }; 53121E1A23042C6400148925 /* Nimble.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Nimble.framework; sourceTree = ""; }; + 53121E36230431C500148925 /* NimbleFeedbackTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NimbleFeedbackTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 53121E38230431C500148925 /* NimbleFeedbackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NimbleFeedbackTests.swift; sourceTree = ""; }; + 53121E3A230431C500148925 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 53121E442304332300148925 /* DummyState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyState.swift; sourceTree = ""; }; + 538D47C72304494400F356B0 /* DummyStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyStateTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -29,6 +66,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 53121E33230431C500148925 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 53121E3B230431C500148925 /* NimbleFeedback.framework in Frameworks */, + 538D47C923044A2900F356B0 /* Nimble.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -37,6 +83,7 @@ children = ( 53121D4B23042C6400148925 /* Carthage */, 53121D4023042AE100148925 /* NimbleFeedback */, + 53121E37230431C500148925 /* NimbleFeedbackTests */, 53121D3F23042AE100148925 /* Products */, 53121E3023042C8800148925 /* Frameworks */, ); @@ -46,6 +93,7 @@ isa = PBXGroup; children = ( 53121D3E23042AE100148925 /* NimbleFeedback.framework */, + 53121E36230431C500148925 /* NimbleFeedbackTests.xctest */, ); name = Products; sourceTree = ""; @@ -91,6 +139,17 @@ name = Frameworks; sourceTree = ""; }; + 53121E37230431C500148925 /* NimbleFeedbackTests */ = { + isa = PBXGroup; + children = ( + 53121E38230431C500148925 /* NimbleFeedbackTests.swift */, + 53121E3A230431C500148925 /* Info.plist */, + 53121E442304332300148925 /* DummyState.swift */, + 538D47C72304494400F356B0 /* DummyStateTests.swift */, + ); + path = NimbleFeedbackTests; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -123,12 +182,32 @@ productReference = 53121D3E23042AE100148925 /* NimbleFeedback.framework */; productType = "com.apple.product-type.framework"; }; + 53121E35230431C500148925 /* NimbleFeedbackTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 53121E3E230431C500148925 /* Build configuration list for PBXNativeTarget "NimbleFeedbackTests" */; + buildPhases = ( + 53121E32230431C500148925 /* Sources */, + 53121E33230431C500148925 /* Frameworks */, + 53121E34230431C500148925 /* Resources */, + 53121E412304330100148925 /* Copy Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 53121E3D230431C500148925 /* PBXTargetDependency */, + ); + name = NimbleFeedbackTests; + productName = NimbleFeedbackTests; + productReference = 53121E36230431C500148925 /* NimbleFeedbackTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 53121D3523042AE100148925 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1030; LastUpgradeCheck = 1030; ORGANIZATIONNAME = Trafi; TargetAttributes = { @@ -136,6 +215,9 @@ CreatedOnToolsVersion = 10.3; LastSwiftMigration = 1030; }; + 53121E35230431C500148925 = { + CreatedOnToolsVersion = 10.3; + }; }; }; buildConfigurationList = 53121D3823042AE100148925 /* Build configuration list for PBXProject "NimbleFeedback" */; @@ -151,6 +233,7 @@ projectRoot = ""; targets = ( 53121D3D23042AE100148925 /* NimbleFeedback */, + 53121E35230431C500148925 /* NimbleFeedbackTests */, ); }; /* End PBXProject section */ @@ -163,6 +246,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 53121E34230431C500148925 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -174,8 +264,26 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 53121E32230431C500148925 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 538D47C82304494400F356B0 /* DummyStateTests.swift in Sources */, + 53121E452304332300148925 /* DummyState.swift in Sources */, + 53121E39230431C500148925 /* NimbleFeedbackTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 53121E3D230431C500148925 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 53121D3D23042AE100148925 /* NimbleFeedback */; + targetProxy = 53121E3C230431C500148925 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 53121D4423042AE100148925 /* Debug */ = { isa = XCBuildConfiguration; @@ -213,6 +321,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -277,6 +386,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -360,6 +470,50 @@ }; name = Release; }; + 53121E3F230431C500148925 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2NLF64332K; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = NimbleFeedbackTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.trafi.NimbleFeedbackTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 53121E40230431C500148925 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 2NLF64332K; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = NimbleFeedbackTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.trafi.NimbleFeedbackTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -381,6 +535,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 53121E3E230431C500148925 /* Build configuration list for PBXNativeTarget "NimbleFeedbackTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 53121E3F230431C500148925 /* Debug */, + 53121E40230431C500148925 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 53121D3523042AE100148925 /* Project object */; diff --git a/NimbleFeedback.xcodeproj/xcshareddata/xcschemes/NimbleFeedback.xcscheme b/NimbleFeedback.xcodeproj/xcshareddata/xcschemes/NimbleFeedback.xcscheme new file mode 100644 index 0000000..6231574 --- /dev/null +++ b/NimbleFeedback.xcodeproj/xcshareddata/xcschemes/NimbleFeedback.xcscheme @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NimbleFeedbackTests/DummyState.swift b/NimbleFeedbackTests/DummyState.swift new file mode 100644 index 0000000..943b83d --- /dev/null +++ b/NimbleFeedbackTests/DummyState.swift @@ -0,0 +1,27 @@ +@testable import NimbleFeedback + +struct DummyState: State { + + enum Event { + case none + case alpha + case beta + } + + var lastEvent: Event? + + static func reduce(state: DummyState, event: DummyState.Event) -> DummyState { + var result = state + + result.lastEvent = (event == .none ? nil : event) + + return result + } + + var isAlpha: Bool? { + if let le = lastEvent { + return le == .alpha + } + return nil + } +} diff --git a/NimbleFeedbackTests/DummyStateTests.swift b/NimbleFeedbackTests/DummyStateTests.swift new file mode 100644 index 0000000..22b6564 --- /dev/null +++ b/NimbleFeedbackTests/DummyStateTests.swift @@ -0,0 +1,33 @@ +import XCTest + +class DummyStateTests: XCTestCase { + + var state: DummyState! + + override func setUp() { + super.setUp() + state = DummyState(lastEvent: nil) + } + + func test_apply_dummyGetsAlpha() { + state.apply(.alpha) + XCTAssertEqual(.alpha, state.lastEvent) + } + + func test_apply_dummyGetsNone() { + state.apply(.none) + XCTAssertNil(state.lastEvent) + } + + func test_state_isAlpha() { + XCTAssertNil(state.isAlpha) + state.apply(.alpha) + XCTAssertEqual(true, state.isAlpha) + } + + func test_state_isNotAlpha() { + XCTAssertNil(state.isAlpha) + state.apply(.beta) + XCTAssertEqual(false, state.isAlpha) + } +} diff --git a/NimbleFeedbackTests/Info.plist b/NimbleFeedbackTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/NimbleFeedbackTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/NimbleFeedbackTests/NimbleFeedbackTests.swift b/NimbleFeedbackTests/NimbleFeedbackTests.swift new file mode 100644 index 0000000..a747bc3 --- /dev/null +++ b/NimbleFeedbackTests/NimbleFeedbackTests.swift @@ -0,0 +1,21 @@ +@testable import NimbleFeedback +import Nimble +import XCTest + +class NimbleFeedbackTests: XCTestCase { + + var state: DummyState! + + override func setUp() { + super.setUp() + state = DummyState(lastEvent: nil) + } + + func test_expectation_acceptsEvents() { + let exp_00 = expect(self.state).after(.alpha) + XCTAssertEqual([.alpha], exp_00.events) + + let exp_01 = expect(self.state).after([.alpha]) + XCTAssertEqual([.alpha], exp_01.events) + } +}