Skip to content

Commit

Permalink
Fixed Unit Tests/ Travis (trustwallet#610)
Browse files Browse the repository at this point in the history
* Fixed Unit Tests

* Update gems

* Remove web3
  • Loading branch information
MillerApps authored and vikmeup committed Apr 13, 2018
1 parent 090c31a commit b16f08b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 47 deletions.
87 changes: 50 additions & 37 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
CFPropertyList (3.0.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.2)
babosa (1.0.2)
claide (1.0.2)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
cocoapods (1.3.1)
cocoapods (1.5.0)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.3.1)
cocoapods-deintegrate (>= 1.0.1, < 2.0)
cocoapods-downloader (>= 1.1.3, < 2.0)
cocoapods-core (= 1.5.0)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.2.0, < 2.0)
cocoapods-trunk (>= 1.3.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.5.7)
molinillo (~> 0.6.5)
nap (~> 1.0)
ruby-macho (~> 1.1)
xcodeproj (>= 1.5.1, < 2.0)
cocoapods-core (1.3.1)
xcodeproj (>= 1.5.7, < 2.0)
cocoapods-core (1.5.0)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.3)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.2.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
Expand All @@ -50,7 +51,7 @@ GEM
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.5)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.0.5)
cork (0.3.0)
Expand All @@ -67,18 +68,19 @@ GEM
no_proxy_fix
octokit (~> 4.7)
terminal-table (~> 1)
danger-swiftlint (0.13.1)
danger-swiftlint (0.16.0)
danger
rake (> 10)
thor (~> 0.19)
declarative (0.0.10)
declarative-option (0.1.0)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
dotenv (2.2.2)
emoji_regex (0.1.1)
escape (0.0.4)
excon (0.60.0)
faraday (0.13.1)
excon (0.62.0)
faraday (0.14.0)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
Expand All @@ -88,20 +90,21 @@ GEM
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.1)
fastlane (2.70.3)
CFPropertyList (>= 2.3, < 3.0.0)
fastlane (2.91.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0)
colored
commander-fastlane (>= 4.4.5, < 5.0.0)
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (~> 0.1)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.0.1, < 2.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.13.1, < 0.14.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
Expand All @@ -113,17 +116,19 @@ GEM
public_suffix (~> 2.0.0)
rubyzip (>= 1.1.0, < 2.0.0)
security (= 0.1.3)
slack-notifier (>= 1.3, < 2.0.0)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (~> 0.6.3)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.5.2, < 2.0.0)
xcodeproj (>= 1.5.7, < 2.0.0)
xcpretty (>= 0.2.4, < 1.0.0)
xcpretty-travis-formatter (>= 0.0.3)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.3)
gh_inspector (1.1.3)
git (1.3.0)
google-api-client (0.13.6)
addressable (~> 2.5, >= 2.5.1)
Expand All @@ -144,7 +149,7 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (0.9.1)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.1.0)
jwt (2.1.0)
Expand All @@ -158,13 +163,14 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
minitest (5.10.3)
molinillo (0.5.7)
multi_json (1.12.2)
minitest (5.11.3)
molinillo (0.6.5)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.3)
nanaimo (0.2.5)
nap (1.1.0)
naturally (2.1.0)
netrc (0.11.0)
no_proxy_fix (0.1.2)
octokit (4.8.0)
Expand All @@ -173,7 +179,7 @@ GEM
os (0.9.6)
plist (3.4.0)
public_suffix (2.0.5)
rake (12.3.0)
rake (12.3.1)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
Expand All @@ -191,26 +197,33 @@ GEM
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
slack-notifier (1.5.1)
simctl (1.6.3)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (1.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thor (0.20.0)
thread_safe (0.3.6)
tty-screen (0.6.3)
tzinfo (1.2.4)
tty-cursor (0.5.0)
tty-screen (0.6.4)
tty-spinner (0.8.0)
tty-cursor (>= 0.5.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.4)
unf_ext (0.0.7.5)
unicode-display_width (1.3.0)
word_wrap (1.0.0)
xcodeproj (1.5.4)
CFPropertyList (~> 2.3.3)
xcodeproj (1.5.7)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.2)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.3)
nanaimo (~> 0.2.4)
xcpretty (0.2.8)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import XCTest

class LockCreatePasscodeCoordinatorTest: XCTestCase {
func testStart() {
let navigationController = UINavigationController()
let navigationController = NavigationController()
let coordinator = LockCreatePasscodeCoordinator(navigationController: navigationController, model: LockCreatePasscodeViewModel())
coordinator.start()
XCTAssertTrue(navigationController.viewControllers.first is LockCreatePasscodeViewController)
}
func testStop() {
let navigationController = UINavigationController()
let navigationController = NavigationController()
let coordinator = LockCreatePasscodeCoordinator(navigationController: navigationController, model: LockCreatePasscodeViewModel())
coordinator.start()
XCTAssertTrue(navigationController.viewControllers.first is LockCreatePasscodeViewController)
Expand Down
4 changes: 1 addition & 3 deletions TrustTests/Factories/FakeGetBalanceCoordinator(.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ import Foundation
@testable import Trust

class FakeGetBalanceCoordinator: TokensBalanceService {
convenience init() {
self.init(web3: Web3Swift())
}

}
1 change: 1 addition & 0 deletions TrustTests/Factories/FakeNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import Foundation
import UIKit
@testable import Trust

class FakeNavigationController: NavigationController {

Expand Down
6 changes: 1 addition & 5 deletions TrustTests/Factories/WalletSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,26 @@ import BigInt
extension WalletSession {
static func make(
account: Trust.Wallet = .make(),
config: Config = .make(),
web3: Web3Swift = Web3Swift()
config: Config = .make()
) -> WalletSession {
let balance = BalanceCoordinator(account: account, config: config, storage: FakeTokensDataStore())
return WalletSession(
account: account,
config: config,
web3: web3,
balanceCoordinator: balance,
nonceProvider: GetNonceProvider.make()
)
}
static func makeWithEthBalance(
account: Trust.Wallet = .make(),
config: Config = .make(),
web3: Web3Swift = Web3Swift(),
amount: String
) -> WalletSession {
let balance = BalanceCoordinator(account: account, config: config, storage: FakeTokensDataStore())
balance.balance = Balance(value:BigInt(amount)!)
return WalletSession(
account: account,
config: config,
web3: web3,
balanceCoordinator: balance,
nonceProvider: GetNonceProvider.make()
)
Expand Down

0 comments on commit b16f08b

Please sign in to comment.