spec/matcher_spec.rb in storyboardlint-0.2.1 vs spec/matcher_spec.rb in storyboardlint-0.2.2
- old
+ new
@@ -149,8 +149,19 @@
r = @m.reuse_id_regex_source
"test".should_not match(r)
"cellpretest".should_not match(r)
'@"cellpretest"'.should match(r)
end
+
+ it "should only capture the actual ID" do
+ options = OpenStruct.new
+ options.reuse_suffix = "Cell"
+ m = StoryboardLint::Matcher.new(options)
+ r = m.reuse_id_regex_source
+ test_string = '@"cellName" : @"bronzeTableCell"'
+ test_string.should match(r)
+ test_string =~ r
+ $1.should == 'bronzeTableCell'
+ end
end
end
\ No newline at end of file