Latest 1.0.1
Homepage https://github.com/417-72KI/MockUserDefaults
License MIT
Platforms ios 10.0, osx 10.9, watchos 3.0, tvos 10.0, requires ARC
Frameworks Foundation
Authors

Build Status
Version
Platform
GitHub release
Swift4.2
Swift5
GitHub license

MockUserDefaults is a simple replacement for NSUserDefaults/UserDefaults to make test easier.

Installation

CocoaPods

“`ruby:Podfile
pod ‘MockUserDefaults’, ‘~> 1.0’


### Carthage
```ruby:Cartfile
github "417-72KI/MockUserDefaults" ~> 1.0

Usage

Objective-C

NSUserDefaults *userDefaults = [NSUserDefaults mockedUserDefaults];
[userDefaults setObject:@"string" forKey:@"key"];

XCTAssertEqualObjects([userDefaults objectForKey:@"key"], @"string");

Swift

let userDefaults: UserDefaults = .mocked
userDefaults.set("string", forKey: "key")

XCTAssertEqual(userDefaults.string(forKey: "key"), "string")

Latest podspec

{
    "name": "MockUserDefaults",
    "version": "1.0.1",
    "summary": "Mocking UserDefaults for tests",
    "description": "MockUserDefaults is a simple replacement for NSUserDefaults/UserDefaults to make test easier.",
    "homepage": "https://github.com/417-72KI/MockUserDefaults",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "417.72KI": "[email protected]"
    },
    "social_media_url": "http://twitter.com/417_72KI",
    "platforms": {
        "ios": "10.0",
        "osx": "10.9",
        "watchos": "3.0",
        "tvos": "10.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/417-72KI/MockUserDefaults.git",
        "tag": "1.0.1"
    },
    "source_files": "MockUserDefaults/**/*.{h,m}",
    "public_header_files": "MockUserDefaults/**/*.h",
    "frameworks": "Foundation"
}

Pin It on Pinterest

Share This