File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ internals.Registry = class {
4747 this . _definitions = new internals . Definitions ( ) ;
4848 }
4949
50+ get definitions ( ) {
51+
52+ return [ ] . concat ( ...this . _definitions . values ( ) ) ;
53+ }
54+
5055 add ( ...definitions ) {
5156
5257 definitions = Schemas . definitions . attempt ( definitions ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,27 @@ describe('registry()', () => {
2222 } ) ;
2323 } ) ;
2424
25+ describe ( 'definitions' , ( ) => {
26+
27+ it ( 'should return all the definitions' , ( ) => {
28+
29+ const registry = Ruby . registry ( ) ;
30+ registry . add ( {
31+ name : 'simple' ,
32+ } , {
33+ name : 'complex' ,
34+ args : [ 'arg1' , 'arg2' ] ,
35+ } ) ;
36+
37+ const definitions = [
38+ { name : 'simple' } ,
39+ { name : 'complex' , args : [ { name : 'arg1' } , { name : 'arg2' } ] } ,
40+ ] ;
41+
42+ expect ( Bone . equal ( registry . definitions , definitions ) ) . toBe ( true ) ;
43+ } ) ;
44+ } ) ;
45+
2546 describe ( 'match()' , ( ) => {
2647
2748 it ( 'should return null for mismatching prefixes' , ( ) => {
You can’t perform that action at this time.
0 commit comments