diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-02-25 16:18:57 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-02-25 16:18:57 -0500 |
commit | ecb18b57084718ed31a90885736e374b5c02d525 (patch) | |
tree | defc1f06c5d622700efd3a01cdfea7b018c6d615 | |
parent | 4950cbc5ed3b9b893020c82e809074cd13d9c132 (diff) | |
download | sdl_ios-ecb18b57084718ed31a90885736e374b5c02d525.tar.gz |
Fix SDLObjectWithPrioritySpec
-rw-r--r-- | SmartDeviceLink-iOS/SmartDeviceLinkTests/UtilitiesSpecs/Prioritized Objects/SDLObjectWithPrioritySpec.m | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/SmartDeviceLink-iOS/SmartDeviceLinkTests/UtilitiesSpecs/Prioritized Objects/SDLObjectWithPrioritySpec.m b/SmartDeviceLink-iOS/SmartDeviceLinkTests/UtilitiesSpecs/Prioritized Objects/SDLObjectWithPrioritySpec.m index dd8348e89..73ca3f7ea 100644 --- a/SmartDeviceLink-iOS/SmartDeviceLinkTests/UtilitiesSpecs/Prioritized Objects/SDLObjectWithPrioritySpec.m +++ b/SmartDeviceLink-iOS/SmartDeviceLinkTests/UtilitiesSpecs/Prioritized Objects/SDLObjectWithPrioritySpec.m @@ -12,23 +12,42 @@ QuickSpecBegin(SDLObjectWithPrioritySpec) describe(@"a prioritized object", ^{ - it(@"should initialize properly", ^{ - SDLObjectWithPriority *object = [[SDLObjectWithPriority alloc] init]; + __block SDLObjectWithPriority *testObject = nil; + + beforeEach(^{ + testObject = [[SDLObjectWithPriority alloc] init]; + }); + + describe(@"should initialize properly", ^{ + it(@"should not be nil", ^{ + expect(testObject).toNot(beNil()); + }); - expect(object).toNot(beNil()); - expect(object.object).to(beNil()); - expect(@(object.priority)).to(equal(@0)); + it(@"should store a nil object", ^{ + expect(testObject.object).to(beNil()); + }); + + it(@"should have a priority of 0", ^{ + expect(@(testObject.priority)).to(equal(@(NSIntegerMax))); + }); }); - it(@"should store an object properly", ^{ - NSString *testString = @"TestString"; - SDLObjectWithPriority *object = [[SDLObjectWithPriority alloc] init]; + describe(@"should store an object properly", ^{ + __block NSString *testString = nil; + + beforeEach(^{ + testString = @"TestString"; + testObject.object = testString; + testObject.priority = 100; + }); - object.object = testString; - object.priority = 100; + it(@"should store the string as it's object", ^{ + expect(testObject.object).to(equal(testString)); + }); - expect(object.object).to(equal(testString)); - expect(@(object.priority)).to(equal(@100)); + it(@"should set the priority as specified", ^{ + expect(@(testObject.priority)).to(equal(@100)); + }); }); }); |