Skip to content
Browse files

Added unit test for #358

  • Loading branch information...
1 parent 2e53667 commit c22b7ec9a243a4b571ac27cbcaea0747296131e9 @odrobnik odrobnik committed with Mar 24, 2013
Showing with 19 additions and 0 deletions.
  1. +19 −0 Core/Test/Source/DTCSSStylesheetTest.m
View
19 Core/Test/Source/DTCSSStylesheetTest.m
@@ -42,6 +42,25 @@ - (void)testAttributeWithWhitespace
STAssertEqualObjects(empty2, @"", @"empty2 should match");
}
+- (void)testImportant
+{
+ NSString *string = @"p {align: center !IMPORTANT;color:blue;}";
+
+ DTCSSStylesheet *stylesheet = [[DTCSSStylesheet alloc] initWithStyleBlock:string];
+
+ NSDictionary *styles = [stylesheet.styles objectForKey:@"p"];
+
+ STAssertEquals([styles count], 2u, @"There should be 2 styles");
+
+ NSString *alignStyle = [styles objectForKey:@"align"];
+
+ STAssertEqualObjects(alignStyle, @"center", @"Align should be 'center', but is '%@'", alignStyle);
+
+ NSString *colorStyle = [styles objectForKey:@"color"];
+
+ STAssertEqualObjects(colorStyle, @"blue", @"Color should be 'blue', but is '%@'", colorStyle);
+}
+
- (void)testMerging
{
DTCSSStylesheet *stylesheet = [[DTCSSStylesheet defaultStyleSheet] copy];

0 comments on commit c22b7ec

Please sign in to comment.
Something went wrong with that request. Please try again.