This repository has been archived by the owner on Jan 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
NSString+CRLAttributedUtilsSpec.m
45 lines (37 loc) · 1.77 KB
/
NSString+CRLAttributedUtilsSpec.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Sidecar
// Copyright (c) 2015, Crush & Lovely <engineering@crushlovely.com>
// Under the MIT License; see LICENSE file for details.
#import "Specta.h"
#import "NSString+CRLAttributedUtils.h"
SpecBegin(NSString_CRLAttributedUtils)
describe(@"crl_attributedCopy", ^{
it(@"should return an attributed copy of the receiver with no attributes", ^{
NSString *s = @"hello";
NSAttributedString *attributedCopy = [s crl_attributedCopy];
expect(attributedCopy).to.equal([[NSAttributedString alloc] initWithString:s]);
});
});
describe(@"crl_attributedCopyWithAttributes:", ^{
it(@"should return an attributed copy of the receiver with the given attributes", ^{
NSString *s = @"hello";
NSDictionary *attrs = @{ @"nonsense": @123 };
NSAttributedString *attributedCopy = [s crl_attributedCopyWithAttributes:attrs];
expect(attributedCopy).to.equal([[NSAttributedString alloc] initWithString:s attributes:attrs]);
});
});
describe(@"crl_mutableAttributedCopy", ^{
it(@"should return a mutable attributed copy of the receiver with no attributes", ^{
NSString *s = @"hello";
NSMutableAttributedString *attributedCopy = [s crl_mutableAttributedCopy];
expect(attributedCopy).to.equal([[NSMutableAttributedString alloc] initWithString:s]);
});
});
describe(@"crl_mutableAttributedCopyWithAttributes:", ^{
it(@"should return a mutable attributed copy of the receiver with the given attributes", ^{
NSString *s = @"hello";
NSDictionary *attrs = @{ @"nonsense": @123 };
NSMutableAttributedString *attributedCopy = [s crl_mutableAttributedCopyWithAttributes:attrs];
expect(attributedCopy).to.equal([[NSMutableAttributedString alloc] initWithString:s attributes:attrs]);
});
});
SpecEnd