@@ -24,9 +24,23 @@ describe("RooProtectedController", () => {
2424 expect ( controller . isWriteProtected ( ".rooprotected" ) ) . toBe ( true )
2525 } )
2626
27- it ( "should protect files starting with .roo" , ( ) => {
28- expect ( controller . isWriteProtected ( ".roosettings" ) ) . toBe ( true )
29- expect ( controller . isWriteProtected ( ".rooconfig" ) ) . toBe ( true )
27+ it ( "should protect .roomodes files" , ( ) => {
28+ expect ( controller . isWriteProtected ( ".roomodes" ) ) . toBe ( true )
29+ } )
30+
31+ it ( "should protect .roorules* files" , ( ) => {
32+ expect ( controller . isWriteProtected ( ".roorules" ) ) . toBe ( true )
33+ expect ( controller . isWriteProtected ( ".roorules.md" ) ) . toBe ( true )
34+ } )
35+
36+ it ( "should protect .clinerules* files" , ( ) => {
37+ expect ( controller . isWriteProtected ( ".clinerules" ) ) . toBe ( true )
38+ expect ( controller . isWriteProtected ( ".clinerules.md" ) ) . toBe ( true )
39+ } )
40+
41+ it ( "should not protect other files starting with .roo" , ( ) => {
42+ expect ( controller . isWriteProtected ( ".roosettings" ) ) . toBe ( false )
43+ expect ( controller . isWriteProtected ( ".rooconfig" ) ) . toBe ( false )
3044 } )
3145
3246 it ( "should not protect regular files" , ( ) => {
@@ -41,8 +55,10 @@ describe("RooProtectedController", () => {
4155 } )
4256
4357 it ( "should handle nested paths correctly" , ( ) => {
44- expect ( controller . isWriteProtected ( "src/ .roo/config.json" ) ) . toBe ( true ) // .roo/** matches anywhere
58+ expect ( controller . isWriteProtected ( ".roo/config.json" ) ) . toBe ( true ) // .roo/** matches at root
4559 expect ( controller . isWriteProtected ( "nested/.rooignore" ) ) . toBe ( true ) // .rooignore matches anywhere by default
60+ expect ( controller . isWriteProtected ( "nested/.roomodes" ) ) . toBe ( true ) // .roomodes matches anywhere by default
61+ expect ( controller . isWriteProtected ( "nested/.roorules.md" ) ) . toBe ( true ) // .roorules* matches anywhere by default
4662 } )
4763
4864 it ( "should handle absolute paths by converting to relative" , ( ) => {
@@ -112,7 +128,14 @@ describe("RooProtectedController", () => {
112128 it ( "should return the list of protected patterns" , ( ) => {
113129 const patterns = RooProtectedController . getProtectedPatterns ( )
114130
115- expect ( patterns ) . toEqual ( [ ".rooignore" , ".roo/**" , ".rooprotected" , ".roo*" ] )
131+ expect ( patterns ) . toEqual ( [
132+ ".rooignore" ,
133+ ".roomodes" ,
134+ ".roorules*" ,
135+ ".clinerules*" ,
136+ ".roo/**" ,
137+ ".rooprotected" ,
138+ ] )
116139 } )
117140 } )
118141} )
0 commit comments