sproutit-sproutcore 1.0.0.20090416161445 → 1.0.0.20090720093355
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Buildfile +4 -2
- data/frameworks/sproutcore/Buildfile +3 -2
- data/frameworks/sproutcore/README +2 -1
- data/frameworks/sproutcore/apps/docs/core.js +27 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/data.plist +14378 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image10.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image11.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image13.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image14.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image8.png +0 -0
- data/frameworks/sproutcore/apps/docs/design/Doc Viewer.graffle/image9.tiff +0 -0
- data/frameworks/sproutcore/apps/docs/english.lproj/loading.rhtml +9 -0
- data/frameworks/sproutcore/apps/docs/english.lproj/main_page.js +22 -0
- data/frameworks/sproutcore/apps/{sc_jsdoc → docs}/english.lproj/strings.js +7 -7
- data/frameworks/sproutcore/apps/docs/main.js +30 -0
- data/frameworks/sproutcore/apps/tests/controllers/detail.js +16 -0
- data/frameworks/sproutcore/apps/tests/controllers/source.js +29 -0
- data/frameworks/sproutcore/apps/tests/controllers/target.js +26 -0
- data/frameworks/sproutcore/apps/tests/controllers/targets.js +65 -26
- data/frameworks/sproutcore/apps/tests/controllers/tests.js +14 -19
- data/frameworks/sproutcore/apps/tests/core.js +114 -16
- data/frameworks/sproutcore/apps/tests/data_source.js +96 -0
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.css +22 -2
- data/frameworks/sproutcore/apps/tests/english.lproj/main_page.js +168 -22
- data/frameworks/sproutcore/apps/tests/english.lproj/strings.js +14 -5
- data/frameworks/sproutcore/apps/tests/fixtures/target.js +81 -37
- data/frameworks/sproutcore/apps/tests/fixtures/test.js +38 -37
- data/frameworks/sproutcore/apps/tests/main.js +9 -20
- data/frameworks/sproutcore/apps/tests/models/target.js +74 -31
- data/frameworks/sproutcore/apps/tests/models/test.js +30 -2
- data/frameworks/sproutcore/{frameworks/desktop/mixins/collection_item.js → apps/tests/states/no_targets.js} +16 -12
- data/frameworks/sproutcore/apps/tests/states/ready.js +56 -0
- data/frameworks/sproutcore/apps/tests/states/ready_detail.js +41 -0
- data/frameworks/sproutcore/apps/tests/states/ready_empty.js +48 -0
- data/frameworks/sproutcore/apps/tests/states/ready_list.js +41 -0
- data/frameworks/sproutcore/apps/tests/states/ready_loading.js +44 -0
- data/frameworks/sproutcore/apps/tests/states/ready_no_tests.js +31 -0
- data/frameworks/sproutcore/apps/tests/states/start.js +39 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/{test.js → detail.js} +3 -3
- data/frameworks/sproutcore/apps/tests/tests/controllers/source.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/target.js +15 -0
- data/frameworks/sproutcore/apps/tests/tests/controllers/targets.js +3 -3
- data/frameworks/sproutcore/apps/tests/tests/views/offset_checkbox.js +15 -0
- data/frameworks/sproutcore/apps/tests/views/offset_checkbox.js +26 -0
- data/frameworks/sproutcore/design/CollectionView State Charts.graffle +4848 -0
- data/frameworks/sproutcore/design/Design Charts.graffle +8788 -6375
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/data.plist +1452 -0
- data/frameworks/sproutcore/design/SproutCore Design Template.graffle/image8.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Preview.pdf +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/QuickLook/Thumbnail.tiff +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/data.plist +24187 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image10.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image11.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image13.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image15.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image16.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image17.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image18.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image19.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image22.tiff +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image23.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image24.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image25.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image30.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image31.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image8.png +0 -0
- data/frameworks/sproutcore/design/TestRunner Design.graffle/image9.png +0 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +2 -2
- data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +66 -49
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +146 -31
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures_with_queries.js +238 -0
- data/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +27 -11
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +163 -32
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +67 -5
- data/frameworks/sproutcore/frameworks/datastore/system/many_array.js +157 -0
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +202 -19
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +929 -78
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +143 -5
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +443 -125
- data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +38 -3
- data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +94 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +30 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/normalize.js +238 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +105 -16
- data/frameworks/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +178 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +9 -8
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +6 -6
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +6 -6
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +3 -3
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +7 -7
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +4 -4
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +7 -7
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +7 -7
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/compare_records.js +126 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +165 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +82 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/find_all.js +362 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/parsing.js +170 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +43 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +60 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +67 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +2 -13
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +3 -4
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +73 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +15 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +4 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +2 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +1 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +2 -2
- data/frameworks/sproutcore/frameworks/debug/core.js +60 -0
- data/frameworks/sproutcore/frameworks/deprecated/core.js +0 -2
- data/frameworks/sproutcore/frameworks/deprecated/server/server.js +0 -1
- data/frameworks/sproutcore/frameworks/deprecated/system/browser.js +0 -2
- data/frameworks/sproutcore/frameworks/deprecated/system/classic_responder.js +0 -2
- data/frameworks/sproutcore/frameworks/deprecated/system/event.js +0 -2
- data/frameworks/sproutcore/frameworks/deprecated/system/misc.js +0 -2
- data/frameworks/sproutcore/frameworks/deprecated/system/object.js +0 -2
- data/frameworks/sproutcore/frameworks/deprecated/system/path_module.js +0 -1
- data/frameworks/sproutcore/frameworks/deprecated/system/string.js +0 -2
- data/frameworks/sproutcore/frameworks/designer/coders/design.js +1 -2
- data/frameworks/sproutcore/frameworks/designer/coders/localization.js +1 -2
- data/frameworks/sproutcore/frameworks/designer/coders/object.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/controllers/page_design.js +1 -1
- data/frameworks/sproutcore/frameworks/designer/ext/page.js +0 -2
- data/frameworks/sproutcore/frameworks/designer/ext/view.js +0 -2
- data/frameworks/sproutcore/frameworks/designer/views/controls/button.js +2 -3
- data/frameworks/sproutcore/frameworks/designer/views/designer.js +24 -8
- data/frameworks/sproutcore/frameworks/designer/views/label.js +1 -2
- data/frameworks/sproutcore/frameworks/designer/views/mixins/button.js +0 -2
- data/frameworks/sproutcore/frameworks/designer/views/tab.js +1 -2
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/alert.css +2 -2
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/drag.css +6 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/list_item.css +63 -10
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +5 -4
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/modal.css +5 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/panel.css +1 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/slider.css +5 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/split_divider.css +1 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/tab.css +1 -1
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +61 -0
- data/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +136 -79
- data/frameworks/sproutcore/frameworks/desktop/panes/alert.js +55 -24
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +295 -147
- data/frameworks/sproutcore/frameworks/desktop/panes/palette.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/panel.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/panes/picker.js +18 -20
- data/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +4 -4
- data/frameworks/sproutcore/frameworks/desktop/system/drag.js +337 -231
- data/frameworks/sproutcore/frameworks/desktop/system/root_responder.js +3 -3
- data/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +46 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +4 -2
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +5 -6
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +11 -11
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +11 -7
- data/frameworks/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +9 -9
- data/frameworks/sproutcore/frameworks/desktop/tests/views/button/ui.js +19 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +0 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/content.js +249 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +82 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +199 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +288 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +65 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/length.js +88 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +165 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +121 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/reload.js +177 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/select.js +240 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +191 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +197 -39
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/selection.js +141 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +182 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +183 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +133 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +132 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +56 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +167 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +127 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list_item.js +30 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +8 -8
- data/frameworks/sproutcore/frameworks/desktop/tests/views/progress/ui.js +9 -9
- data/frameworks/sproutcore/frameworks/desktop/tests/views/scroller/methods.js +45 -6
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +2 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +17 -1
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +44 -29
- data/frameworks/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +231 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/web/ui.js +1 -1
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +15 -4
- data/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +8 -1
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +1739 -1123
- data/frameworks/sproutcore/frameworks/desktop/views/form.js +0 -1
- data/frameworks/sproutcore/frameworks/desktop/views/grid.js +13 -11
- data/frameworks/sproutcore/frameworks/desktop/views/list.js +405 -571
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +211 -74
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +319 -169
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +57 -51
- data/frameworks/sproutcore/frameworks/desktop/views/progress.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/views/scene.js +150 -2
- data/frameworks/sproutcore/frameworks/desktop/views/scroll.js +92 -50
- data/frameworks/sproutcore/frameworks/desktop/views/scroller.js +86 -63
- data/frameworks/sproutcore/frameworks/desktop/views/segmented.js +38 -22
- data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +51 -12
- data/frameworks/sproutcore/frameworks/desktop/views/slider.js +2 -0
- data/frameworks/sproutcore/frameworks/desktop/views/source_list.js +17 -1087
- data/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +3 -3
- data/frameworks/sproutcore/frameworks/desktop/views/split.js +35 -9
- data/frameworks/sproutcore/frameworks/desktop/views/stacked.js +101 -0
- data/frameworks/sproutcore/frameworks/desktop/views/tab.js +23 -22
- data/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +382 -363
- data/frameworks/sproutcore/frameworks/foundation/controllers/controller.js +7 -279
- data/frameworks/sproutcore/frameworks/foundation/controllers/object.js +212 -310
- data/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +109 -0
- data/frameworks/sproutcore/frameworks/foundation/core.js +25 -0
- data/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +30 -8
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +19 -4
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/core.css +219 -3
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +1 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/label.css +30 -0
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/strings.js +15 -0
- data/frameworks/sproutcore/frameworks/{desktop → foundation}/english.lproj/text_field.css +19 -3
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/view.css +6 -1
- data/frameworks/sproutcore/frameworks/foundation/license.js +19 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/button.js +15 -7
- data/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +171 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/control.js +5 -5
- data/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +462 -0
- data/frameworks/sproutcore/frameworks/foundation/mixins/selection_support.js +162 -84
- data/frameworks/sproutcore/frameworks/foundation/mixins/static_layout.js +33 -2
- data/frameworks/sproutcore/frameworks/foundation/mixins/string.js +17 -3
- data/frameworks/sproutcore/frameworks/foundation/mixins/tree_item_content.js +159 -0
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +49 -20
- data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +887 -0
- data/frameworks/sproutcore/frameworks/foundation/system/application.js +36 -0
- data/frameworks/sproutcore/frameworks/foundation/system/benchmark.js +310 -62
- data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +729 -0
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +57 -21
- data/frameworks/sproutcore/frameworks/foundation/system/ready.js +11 -5
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +55 -16
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +152 -27
- data/frameworks/sproutcore/frameworks/foundation/system/responder.js +120 -0
- data/frameworks/sproutcore/frameworks/foundation/system/responder_context.js +243 -0
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +29 -6
- data/frameworks/sproutcore/frameworks/foundation/system/routes.js +143 -102
- data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +9 -2
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +104 -9
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/array_case.js +182 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/enum_case.js +193 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/null_case.js +64 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +136 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/empty_case.js +82 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/multiple_case.js +111 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_case.js +193 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object/single_enumerable_case.js +179 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +108 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +35 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +128 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/mixins/string.js +17 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +325 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +718 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +484 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_core.js +28 -28
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +151 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/get.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_attr.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_basic.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_className.js +12 -12
- data/frameworks/sproutcore/frameworks/foundation/tests/system/render_context/helpers_style.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +52 -14
- data/frameworks/sproutcore/frameworks/foundation/tests/system/root_responder/root_responder.js +27 -23
- data/frameworks/sproutcore/frameworks/foundation/tests/system/timer/schedule.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/date.js +12 -10
- data/frameworks/sproutcore/frameworks/foundation/tests/views/label/ui.js +148 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/pane/append_remove.js +1 -1
- data/frameworks/sproutcore/frameworks/{desktop → foundation}/tests/views/text_field/methods.js +0 -0
- data/frameworks/sproutcore/frameworks/{desktop → foundation}/tests/views/text_field/ui.js +53 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/clippingFrame.js +1 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/convertFrames.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/createChildViews.js +35 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/findLayerInParentLayer.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisible.js +51 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +12 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/layoutStyle.js +83 -3
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/prepareContext.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/updateLayer.js +4 -0
- data/frameworks/sproutcore/frameworks/foundation/views/container.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/views/field.js +27 -16
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +4 -1
- data/frameworks/sproutcore/frameworks/foundation/views/label.js +16 -6
- data/frameworks/sproutcore/frameworks/{desktop → foundation}/views/text_field.js +39 -15
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +328 -83
- data/frameworks/sproutcore/frameworks/runtime/README +1 -0
- data/frameworks/sproutcore/frameworks/runtime/core.js +110 -31
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +238 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +33 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +121 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +34 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +50 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +46 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +371 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +100 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +49 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +94 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +50 -0
- data/frameworks/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +47 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/array.js +320 -110
- data/frameworks/sproutcore/frameworks/runtime/mixins/copyable.js +64 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/delegate_support.js +44 -6
- data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +142 -77
- data/frameworks/sproutcore/frameworks/runtime/mixins/freezable.js +104 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +298 -142
- data/frameworks/sproutcore/frameworks/runtime/private/chain_observer.js +17 -11
- data/frameworks/sproutcore/frameworks/runtime/private/observer_queue.js +55 -15
- data/frameworks/sproutcore/frameworks/runtime/private/observer_set.js +29 -5
- data/frameworks/sproutcore/frameworks/runtime/protocols/observable_protocol.js +40 -0
- data/frameworks/sproutcore/frameworks/runtime/system/binding.js +39 -15
- data/frameworks/sproutcore/frameworks/runtime/system/index_set.js +1166 -0
- data/frameworks/sproutcore/frameworks/runtime/system/object.js +33 -15
- data/frameworks/sproutcore/frameworks/runtime/system/range_observer.js +201 -35
- data/frameworks/sproutcore/frameworks/runtime/system/run_loop.js +42 -15
- data/frameworks/sproutcore/frameworks/runtime/system/selection_set.js +649 -0
- data/frameworks/sproutcore/frameworks/runtime/system/set.js +183 -54
- data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +20 -11
- data/frameworks/sproutcore/frameworks/runtime/tests/core/clone.js +2 -2
- data/frameworks/sproutcore/frameworks/runtime/tests/core/compare.js +44 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/console.js +16 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/core/keys.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/makeArray.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +5 -5
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +57 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +21 -2
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +249 -129
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +11 -2
- data/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +55 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +81 -6
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/add.js +195 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +43 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +74 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/create.js +42 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +38 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +38 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +74 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/max.js +40 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/min.js +40 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +36 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +189 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/object/base.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +59 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +75 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +117 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +110 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +65 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/run_loop.js +3 -3
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/add.js +92 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/copy.js +17 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/indexSetForSource.js +85 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/isEqual.js +60 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/selection_set/remove.js +87 -0
- data/frameworks/sproutcore/frameworks/runtime/tests/system/set.js +4 -25
- data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +39 -1
- data/frameworks/sproutcore/frameworks/testing/core.js +183 -0
- data/frameworks/sproutcore/frameworks/testing/english.lproj/runner.css +126 -0
- data/frameworks/sproutcore/frameworks/testing/extras.js +0 -26
- data/frameworks/sproutcore/frameworks/testing/qunit.js +33 -25
- data/frameworks/sproutcore/frameworks/testing/system/dump.js +205 -0
- data/frameworks/sproutcore/frameworks/testing/system/equiv.js +201 -0
- data/frameworks/sproutcore/frameworks/testing/system/plan.js +691 -0
- data/frameworks/sproutcore/frameworks/testing/system/runner.js +209 -0
- data/frameworks/sproutcore/frameworks/testing/system/suite.js +228 -0
- data/frameworks/sproutcore/frameworks/testing/utils.js +8 -1
- data/frameworks/sproutcore/lib/index.rhtml +4 -1
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/100.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/102.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/110.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/120.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/127.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/24.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/26.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/27.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/28.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/29.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/30.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/31.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/33.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/37.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/41.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/16/99.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/100.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/102.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/110.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/120.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/127.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/24.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/26.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/27.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/28.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/29.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/30.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/31.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/33.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/37.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/41.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/24/99.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/100.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/102.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/110.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/120.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/127.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/24.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/26.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/27.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/28.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/29.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/30.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/31.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/33.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/37.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/41.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/32/99.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/10.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/18.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/19.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/icons/48/2.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x-2.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-sprite.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sc-theme-ysprite.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/shared-icons.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sproutcore-logo.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/Source/sticky-note.psd +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/button.css +191 -193
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/checkbox.css +11 -10
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/collection.css +85 -4
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/core.css +15 -2
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/label.css +0 -26
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/list_item.css +30 -0
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/progress.css +9 -6
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +20 -11
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/segmented.css +192 -54
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/slider.css +56 -24
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/tab.css +13 -7
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/text_field.css +1 -4
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/toolbar.css +4 -1
- data/lib/sproutcore/builders/minify.rb +2 -2
- data/lib/sproutcore/builders/test.rb +1 -1
- data/lib/sproutcore/buildfile.rb +1 -0
- data/lib/sproutcore/rack/dev.rb +1 -1
- data/lib/sproutcore/rack/filesystem.rb +265 -0
- data/lib/sproutcore/rack/proxy.rb +11 -3
- data/lib/sproutcore/rack/service.rb +11 -1
- data/lib/sproutcore/tools.rb +11 -1
- data/lib/sproutcore/tools/server.rb +6 -4
- data/vendor/jsdoc/README.txt +151 -0
- data/vendor/jsdoc/changes.txt +47 -0
- metadata +263 -308
- data/frameworks/sproutcore/apps/sc_jsdoc/controllers/docs.js +0 -149
- data/frameworks/sproutcore/apps/sc_jsdoc/core.js +0 -16
- data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/body.css +0 -17
- data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/body.js +0 -99
- data/frameworks/sproutcore/apps/sc_jsdoc/english.lproj/images/sproutcore-logo.png +0 -0
- data/frameworks/sproutcore/apps/sc_jsdoc/main.js +0 -27
- data/frameworks/sproutcore/apps/sc_jsdoc/models/doc.js +0 -21
- data/frameworks/sproutcore/apps/sc_qunit/controllers/runner.js +0 -209
- data/frameworks/sproutcore/apps/sc_qunit/core.js +0 -16
- data/frameworks/sproutcore/apps/sc_qunit/english.lproj/body.css +0 -17
- data/frameworks/sproutcore/apps/sc_qunit/english.lproj/body.js +0 -107
- data/frameworks/sproutcore/apps/sc_qunit/english.lproj/images/sproutcore-logo.png +0 -0
- data/frameworks/sproutcore/apps/sc_qunit/english.lproj/strings.js +0 -15
- data/frameworks/sproutcore/apps/sc_qunit/main.js +0 -18
- data/frameworks/sproutcore/apps/sc_qunit/models/test.js +0 -24
- data/frameworks/sproutcore/apps/sc_qunit/views/test_iframe.js +0 -52
- data/frameworks/sproutcore/apps/tests/controllers/test.js +0 -20
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/images/blank.gif +0 -0
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/menu.css +0 -83
- data/frameworks/sproutcore/frameworks/desktop/english.lproj/palette.css +0 -3
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/methods.js +0 -10
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/ui.js +0 -110
- data/frameworks/sproutcore/frameworks/foundation/mixins/responder.js +0 -156
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array.js +0 -118
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/controller.js +0 -268
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/object.js +0 -433
- data/frameworks/sproutcore/frameworks/runtime/tests/system/array.js +0 -263
- data/frameworks/sproutcore/frameworks/testing/tests/debug/qunit.js +0 -25
- data/spec/buildtasks/manifest/spec_helper.rb +0 -35
- data/spec/buildtasks/target_spec.rb +0 -214
- data/spec/fixtures/builder_tests/Buildfile +0 -15
- data/spec/fixtures/builder_tests/apps/combine_test/a.js +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/b.js +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/c.js +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +0 -1
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +0 -2
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/icons/image.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/image.jpg +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/rhtml_sample.rhtml +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +0 -4
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/style.css +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/french-icons/fr.png +0 -0
- data/spec/fixtures/builder_tests/apps/html_test/french.lproj/strings.js +0 -4
- data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +0 -1
- data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +0 -15
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +0 -4
- data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +0 -7
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +0 -3
- data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +0 -8
- data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +0 -9
- data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +0 -12
- data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +0 -1
- data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +0 -3
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +0 -1
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +0 -1
- data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +0 -4
- data/spec/fixtures/builder_tests/frameworks/debug/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/debug/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/core.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/qunit/english.lproj/dummy.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/req_style_1.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/strings.js +0 -4
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +0 -1
- data/spec/fixtures/builder_tests/frameworks/req_target_1/req_js_1.js +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/req_style_2.css +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/english.lproj/test.rhtml +0 -1
- data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +0 -1
- data/spec/fixtures/builder_tests/frameworks/req_target_2/lib/alt_layout.rhtml +0 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/req_js_2.js +0 -0
- data/spec/fixtures/builder_tests/themes/sample_theme/Buildfile +0 -1
- data/spec/fixtures/buildfiles/basic/Buildfile +0 -16
- data/spec/fixtures/buildfiles/basic/task_module.rake +0 -6
- data/spec/fixtures/buildfiles/installed/Buildfile +0 -7
- data/spec/fixtures/buildfiles/installed/Buildfile2 +0 -5
- data/spec/fixtures/buildfiles/project_test/Buildfile +0 -4
- data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +0 -2
- data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/Buildfile +0 -1
- data/spec/fixtures/entry_for_project/apps/test_app/frameworks/nested/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/Buildfile +0 -8
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/bars/bar1/foos/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/Buildfile +0 -5
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/custom_foodir/foo2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/custom_foos/foos/not_foo1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/custom/foos/foo1/bars/bar2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/nested/Buildfile +0 -8
- data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +0 -1
- data/spec/fixtures/find_targets/nested/apps/app1/apps/nested_app/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/Apps/app1/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/clients/client1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework1/frameworks/framework1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/frameworks/framework2/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme1/PLACEHOLDER +0 -0
- data/spec/fixtures/find_targets/standard/themes/theme2/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/English.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/FreNCH.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/caps_long_names/UnknOWN.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/english.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/french.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/german.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/italian.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/japanese.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/spanish.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/long_names/unknown.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/no_names/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/de.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-CA.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-GB.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en-US.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/en.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/es.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/foo.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/fr.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/it.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/languages/apps/short_names/ja.lproj/PLACEHOLDER +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/1.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/B.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/a.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/c.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/core.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/B.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/a/b.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/b/a.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/english.lproj/c.css +0 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/lproj/strings.js +0 -1
- data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +0 -1
- data/spec/fixtures/ordered_entries/apps/with_requires/a.js +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/b.js +0 -3
- data/spec/fixtures/ordered_entries/apps/with_requires/c.js +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +0 -2
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +0 -1
- data/spec/fixtures/real_world/Buildfile +0 -12
- data/spec/fixtures/real_world/apps/account/README +0 -1
- data/spec/fixtures/real_world/apps/calendar/README +0 -1
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +0 -1
- data/spec/fixtures/real_world/apps/files/README +0 -1
- data/spec/fixtures/real_world/apps/mail/README +0 -1
- data/spec/fixtures/real_world/apps/mobile_photos/README +0 -1
- data/spec/fixtures/real_world/apps/photos/README +0 -1
- data/spec/fixtures/real_world/apps/uploader/README +0 -1
- data/spec/fixtures/real_world/frameworks/core_files/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/core_photos/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/shared/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +0 -26
- data/spec/fixtures/real_world/frameworks/sproutcore/README +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/apps/test_runner/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/debug-resource.html +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/debug/sample_debug.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/demo2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/debug/sample_debug-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.css +0 -4
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo2.sass +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.haml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.html.erb +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/file_extension_test.rhtml +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/fixtures/sample_fixtures-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/has_require.css +0 -4
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/protocols/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.css +0 -6
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +0 -3
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/tests/sample-loc.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample-json-fixture.json +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/fixtures/sample_fixtures.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/application/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/costello/core.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/data_store/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/debug/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/desktop/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/empty_theme/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/foundation/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/mobile/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/qunit/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/frameworks/uploader/PLACEHOLDER +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/french-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/french.lproj/strings.js +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/german-resource.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/german.lproj/strings.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/has_require.js +0 -4
- data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +0 -6
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample1.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/nested/sample2.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/tests/sample.rhtml +0 -1
- data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +0 -1
- data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
- data/spec/fixtures/real_world/generators/sample_custom/templates/{filename}.js +0 -1
- data/spec/fixtures/recursive_project/Buildfile +0 -8
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/combine_spec.rb +0 -67
- data/spec/lib/builders/html_spec.rb +0 -577
- data/spec/lib/builders/javascript_spec.rb +0 -81
- data/spec/lib/builders/sass_spec.rb +0 -43
- data/spec/lib/builders/spec_helper.rb +0 -30
- data/spec/lib/builders/strings_spec.rb +0 -52
- data/spec/lib/builders/stylesheet_spec.rb +0 -63
- data/spec/lib/builders/test_index_spec.rb +0 -44
- data/spec/lib/builders/test_spec.rb +0 -135
- data/spec/lib/buildfile/config_for_spec.rb +0 -81
- data/spec/lib/buildfile/define_spec.rb +0 -59
- data/spec/lib/buildfile/dup_spec.rb +0 -65
- data/spec/lib/buildfile/invoke_spec.rb +0 -130
- data/spec/lib/buildfile/load_spec.rb +0 -49
- data/spec/lib/buildfile/task/dup_spec.rb +0 -55
- data/spec/lib/buildfile/task_defined_spec.rb +0 -17
- data/spec/lib/buildfile_commands/build_task_spec.rb +0 -19
- data/spec/lib/buildfile_commands/config_spec.rb +0 -97
- data/spec/lib/buildfile_commands/import_spec.rb +0 -17
- data/spec/lib/buildfile_commands/namespace_spec.rb +0 -18
- data/spec/lib/buildfile_commands/proxies_spec.rb +0 -38
- data/spec/lib/buildfile_commands/replace_task_spec.rb +0 -29
- data/spec/lib/buildfile_commands/task_spec.rb +0 -36
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +0 -26
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +0 -27
- data/spec/lib/models/hash_struct/has_options_spec.rb +0 -32
- data/spec/lib/models/hash_struct/hash_spec.rb +0 -64
- data/spec/lib/models/hash_struct/merge_spec.rb +0 -26
- data/spec/lib/models/hash_struct/method_missing.rb +0 -41
- data/spec/lib/models/manifest/add_entry_spec.rb +0 -36
- data/spec/lib/models/manifest/add_transform_spec.rb +0 -90
- data/spec/lib/models/manifest/build_spec.rb +0 -78
- data/spec/lib/models/manifest/entry_for_spec.rb +0 -94
- data/spec/lib/models/manifest/find_entry.rb +0 -84
- data/spec/lib/models/manifest/prepare_spec.rb +0 -62
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +0 -31
- data/spec/lib/models/manifest_entry/prepare_spec.rb +0 -54
- data/spec/lib/models/project/add_target_spec.rb +0 -44
- data/spec/lib/models/project/buildfile_spec.rb +0 -35
- data/spec/lib/models/project/find_targets_for_spec.rb +0 -77
- data/spec/lib/models/project/load_nearest_project_spec.rb +0 -23
- data/spec/lib/models/project/target_for_spec.rb +0 -33
- data/spec/lib/models/project/targets_spec.rb +0 -62
- data/spec/lib/models/target/compute_build_number_spec.rb +0 -125
- data/spec/lib/models/target/config_spec.rb +0 -30
- data/spec/lib/models/target/expand_required_targets_spec.rb +0 -48
- data/spec/lib/models/target/installed_languages_spec.rb +0 -47
- data/spec/lib/models/target/lproj_for_spec.rb +0 -38
- data/spec/lib/models/target/manifest_for_spec.rb +0 -42
- data/spec/lib/models/target/parent_target_spec.rb +0 -21
- data/spec/lib/models/target/prepare_spec.rb +0 -53
- data/spec/lib/models/target/required_targets_spec.rb +0 -119
- data/spec/lib/models/target/target_for_spec.rb +0 -56
- data/spec/lib/tools/build_number_spec.rb +0 -28
- data/spec/lib/tools/gen_spec.rb +0 -207
- data/spec/lib/tools/tools_spec.rb +0 -78
- data/spec/spec_helper.rb +0 -138
- data/vendor/github_gem_lint.rb +0 -22
- data/vendor/yui-compressor/yuicompressor-2.4.2.jar +0 -0
@@ -0,0 +1,205 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore Costello - Property Observing Library
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// Portions ©2008-2009 Apple, Inc. All rights reserved.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
/*globals CoreTest module */
|
9
|
+
|
10
|
+
/**
|
11
|
+
* jsDump
|
12
|
+
* Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
|
13
|
+
* Licensed under BSD (http://www.opensource.org/licenses/bsd-license.php)
|
14
|
+
* Date: 5/15/2008
|
15
|
+
* @projectDescription Advanced and extensible data dumping for Javascript.
|
16
|
+
* @version 1.0.0
|
17
|
+
* @author Ariel Flesler
|
18
|
+
* @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
|
19
|
+
*/
|
20
|
+
(function(){
|
21
|
+
var reName, jsDump;
|
22
|
+
|
23
|
+
function quote( str ){
|
24
|
+
return '"' + str.toString().replace(/"/g, '\\"') + '"';
|
25
|
+
}
|
26
|
+
|
27
|
+
function literal( o ){
|
28
|
+
return o + '';
|
29
|
+
}
|
30
|
+
|
31
|
+
function join( pre, arr, post ){
|
32
|
+
var s = jsDump.separator(),
|
33
|
+
base = jsDump.indent(),
|
34
|
+
inner = jsDump.indent(1);
|
35
|
+
|
36
|
+
if( arr.join ) arr = arr.join( ',' + s + inner );
|
37
|
+
if( !arr ) return pre + post;
|
38
|
+
|
39
|
+
return [ pre, inner + arr, base + post ].join(s);
|
40
|
+
}
|
41
|
+
|
42
|
+
function array( arr ){
|
43
|
+
var i = arr.length, ret = new Array(i);
|
44
|
+
this.up();
|
45
|
+
while( i-- ) ret[i] = this._parse( arr[i] );
|
46
|
+
this.down();
|
47
|
+
return join( '[', ret, ']' );
|
48
|
+
}
|
49
|
+
|
50
|
+
reName = /^function (\w+)/;
|
51
|
+
|
52
|
+
jsDump = CoreTest.jsDump = {
|
53
|
+
|
54
|
+
parse: function(obj, type) {
|
55
|
+
if (obj && obj.toString) {
|
56
|
+
var toString = obj.toString;
|
57
|
+
if ((toString !== Object.prototype.toString) && (toString !== Array.toString)) return obj.toString();
|
58
|
+
}
|
59
|
+
if (obj && obj.inspect) return obj.inspect();
|
60
|
+
|
61
|
+
this.seen = [];
|
62
|
+
var ret = this._parse(obj, type);
|
63
|
+
this.seen = null;
|
64
|
+
return ret ;
|
65
|
+
},
|
66
|
+
|
67
|
+
//type is used mostly internally, you can fix a (custom)type in advance
|
68
|
+
_parse: function( obj, type ) {
|
69
|
+
|
70
|
+
|
71
|
+
var parser = this.parsers[ type || this.typeOf(obj) ];
|
72
|
+
type = typeof parser;
|
73
|
+
|
74
|
+
// avoid recursive loops
|
75
|
+
if ((parser === this.parsers.object) && (this.seen.indexOf(obj)>=0)) {
|
76
|
+
return '(recursive)';
|
77
|
+
}
|
78
|
+
this.seen.push(obj);
|
79
|
+
|
80
|
+
return type == 'function' ? parser.call( this, obj ) :
|
81
|
+
type == 'string' ? parser :
|
82
|
+
this.parsers.error;
|
83
|
+
},
|
84
|
+
typeOf:function( obj ){
|
85
|
+
var type = typeof obj,
|
86
|
+
f = 'function';//we'll use it 3 times, save it
|
87
|
+
|
88
|
+
if (obj && (obj.isObject || obj.isClass)) return 'scobj';
|
89
|
+
return type != 'object' && type != f ? type :
|
90
|
+
!obj ? 'null' :
|
91
|
+
obj.exec ? 'regexp' :// some browsers (FF) consider regexps functions
|
92
|
+
obj.getHours ? 'date' :
|
93
|
+
obj.scrollBy ? 'window' :
|
94
|
+
obj.nodeName == '#document' ? 'document' :
|
95
|
+
obj.nodeName ? 'node' :
|
96
|
+
obj.item ? 'nodelist' : // Safari reports nodelists as functions
|
97
|
+
obj.callee ? 'arguments' :
|
98
|
+
obj.call || obj.constructor != Array && //an array would also fall on this hack
|
99
|
+
(obj+'').indexOf(f) != -1 ? f : //IE reports functions like alert, as objects
|
100
|
+
'length' in obj ? 'array' :
|
101
|
+
type;
|
102
|
+
},
|
103
|
+
separator:function(){
|
104
|
+
return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? ' ' : ' ';
|
105
|
+
},
|
106
|
+
indent:function( extra ){// extra can be a number, shortcut for increasing-calling-decreasing
|
107
|
+
if( !this.multiline ) return '';
|
108
|
+
|
109
|
+
var chr = this.indentChar;
|
110
|
+
if( this.HTML ) chr = chr.replace(/\t/g,' ').replace(/ /g,' ');
|
111
|
+
return (new Array( this._depth_ + (extra||0) )).join(chr);
|
112
|
+
},
|
113
|
+
up:function( a ){
|
114
|
+
this._depth_ += a || 1;
|
115
|
+
},
|
116
|
+
down:function( a ){
|
117
|
+
this._depth_ -= a || 1;
|
118
|
+
},
|
119
|
+
setParser:function( name, parser ){
|
120
|
+
this.parsers[name] = parser;
|
121
|
+
},
|
122
|
+
// The next 3 are exposed so you can use them
|
123
|
+
quote:quote,
|
124
|
+
literal:literal,
|
125
|
+
join:join,
|
126
|
+
//
|
127
|
+
_depth_: 1,
|
128
|
+
// This is the list of parsers, to modify them, use jsDump.setParser
|
129
|
+
parsers:{
|
130
|
+
window: '[Window]',
|
131
|
+
document: '[Document]',
|
132
|
+
error:'[ERROR]', //when no parser is found, shouldn't happen
|
133
|
+
unknown: '[Unknown]',
|
134
|
+
'null':'null',
|
135
|
+
'undefined':'undefined',
|
136
|
+
'function':function( fn ){
|
137
|
+
var ret = 'function',
|
138
|
+
name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
|
139
|
+
if( name ) ret += ' ' + name;
|
140
|
+
ret += '(';
|
141
|
+
|
142
|
+
ret = [ ret, this._parse( fn, 'functionArgs' ), '){'].join('');
|
143
|
+
return join( ret, this._parse(fn,'functionCode'), '}' );
|
144
|
+
},
|
145
|
+
array: array,
|
146
|
+
nodelist: array,
|
147
|
+
'arguments': array,
|
148
|
+
scobj: function(obj) { return obj.toString(); },
|
149
|
+
object:function( map ){
|
150
|
+
|
151
|
+
var ret = [ ];
|
152
|
+
this.up();
|
153
|
+
for( var key in map ) {
|
154
|
+
ret.push( this._parse(key,'key') + ': ' + this._parse(map[key]) );
|
155
|
+
}
|
156
|
+
this.down();
|
157
|
+
return join( '{', ret, '}' );
|
158
|
+
},
|
159
|
+
node:function( node ){
|
160
|
+
var open = this.HTML ? '<' : '<',
|
161
|
+
close = this.HTML ? '>' : '>';
|
162
|
+
|
163
|
+
var tag = node.nodeName.toLowerCase(),
|
164
|
+
ret = open + tag;
|
165
|
+
|
166
|
+
for( var a in this.DOMAttrs ){
|
167
|
+
var val = node[this.DOMAttrs[a]];
|
168
|
+
if( val ) {
|
169
|
+
ret += ' ' + a + '=' + this._parse( val, 'attribute' );
|
170
|
+
}
|
171
|
+
}
|
172
|
+
return ret + close + open + '/' + tag + close;
|
173
|
+
},
|
174
|
+
functionArgs:function( fn ){//function calls it internally, it's the arguments part of the function
|
175
|
+
var l = fn.length;
|
176
|
+
if( !l ) return '';
|
177
|
+
|
178
|
+
var args = new Array(l);
|
179
|
+
while( l-- ) args[l] = String.fromCharCode(97+l);//97 is 'a'
|
180
|
+
return ' ' + args.join(', ') + ' ';
|
181
|
+
},
|
182
|
+
key:quote, //object calls it internally, the key part of an item in a map
|
183
|
+
functionCode:'[code]', //function calls it internally, it's the content of the function
|
184
|
+
attribute:quote, //node calls it internally, it's an html attribute value
|
185
|
+
string:quote,
|
186
|
+
date:quote,
|
187
|
+
regexp:literal, //regex
|
188
|
+
number:literal,
|
189
|
+
'boolean':literal
|
190
|
+
},
|
191
|
+
DOMAttrs:{//attributes to dump from nodes, name=>realName
|
192
|
+
id:'id',
|
193
|
+
name:'name',
|
194
|
+
'class':'className'
|
195
|
+
},
|
196
|
+
HTML:true,//if true, entities are escaped ( <, >, \t, space and \n )
|
197
|
+
indentChar:' ',//indentation unit
|
198
|
+
multiline:true //if true, items in a collection, are separated by a \n, else just a space.
|
199
|
+
};
|
200
|
+
|
201
|
+
CoreTest.dump = function dump(obj,type) {
|
202
|
+
return CoreTest.jsDump.parse(obj, type);
|
203
|
+
};
|
204
|
+
|
205
|
+
})();
|
@@ -0,0 +1,201 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore Costello - Property Observing Library
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// Portions ©2008-2009 Apple, Inc. All rights reserved.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
/*globals CoreTest */
|
9
|
+
|
10
|
+
/**
|
11
|
+
Tests for equality any JavaScript type and structure without unexpected
|
12
|
+
results.
|
13
|
+
|
14
|
+
Discussions and reference: http://philrathe.com/articles/equiv
|
15
|
+
Test suites: http://philrathe.com/tests/equiv
|
16
|
+
Author: Philippe Rathé <prathe@gmail.com>
|
17
|
+
*/
|
18
|
+
CoreTest.equiv = function () {
|
19
|
+
|
20
|
+
var innerEquiv; // the real equiv function
|
21
|
+
var callers = []; // stack to decide between skip/abort functions
|
22
|
+
|
23
|
+
// Determine what is o.
|
24
|
+
function hoozit(o) {
|
25
|
+
if (typeof o === "string") {
|
26
|
+
return "string";
|
27
|
+
|
28
|
+
} else if (typeof o === "boolean") {
|
29
|
+
return "boolean";
|
30
|
+
|
31
|
+
} else if (typeof o === "number") {
|
32
|
+
|
33
|
+
if (isNaN(o)) {
|
34
|
+
return "nan";
|
35
|
+
} else {
|
36
|
+
return "number";
|
37
|
+
}
|
38
|
+
|
39
|
+
} else if (typeof o === "undefined") {
|
40
|
+
return "undefined";
|
41
|
+
|
42
|
+
// consider: typeof null === object
|
43
|
+
} else if (o === null) {
|
44
|
+
return "null";
|
45
|
+
|
46
|
+
// consider: typeof [] === object
|
47
|
+
} else if (o instanceof Array) {
|
48
|
+
return "array";
|
49
|
+
|
50
|
+
// consider: typeof new Date() === object
|
51
|
+
} else if (o instanceof Date) {
|
52
|
+
return "date";
|
53
|
+
|
54
|
+
// consider: /./ instanceof Object;
|
55
|
+
// /./ instanceof RegExp;
|
56
|
+
// typeof /./ === "function"; // => false in IE and Opera,
|
57
|
+
// true in FF and Safari
|
58
|
+
} else if (o instanceof RegExp) {
|
59
|
+
return "regexp";
|
60
|
+
|
61
|
+
} else if (typeof o === "object") {
|
62
|
+
return "object";
|
63
|
+
|
64
|
+
} else if (o instanceof Function) {
|
65
|
+
return "function";
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
// Call the o related callback with the given arguments.
|
70
|
+
function bindCallbacks(o, callbacks, args) {
|
71
|
+
var prop = hoozit(o);
|
72
|
+
if (prop) {
|
73
|
+
if (hoozit(callbacks[prop]) === "function") {
|
74
|
+
return callbacks[prop].apply(callbacks, args);
|
75
|
+
} else {
|
76
|
+
return callbacks[prop]; // or undefined
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
var callbacks = function () {
|
82
|
+
|
83
|
+
// for string, boolean, number and null
|
84
|
+
function useStrictEquality(b, a) {
|
85
|
+
return a === b;
|
86
|
+
}
|
87
|
+
|
88
|
+
return {
|
89
|
+
"string": useStrictEquality,
|
90
|
+
"boolean": useStrictEquality,
|
91
|
+
"number": useStrictEquality,
|
92
|
+
"null": useStrictEquality,
|
93
|
+
"undefined": useStrictEquality,
|
94
|
+
|
95
|
+
"nan": function (b) {
|
96
|
+
return isNaN(b);
|
97
|
+
},
|
98
|
+
|
99
|
+
"date": function (b, a) {
|
100
|
+
return hoozit(b) === "date" && a.valueOf() === b.valueOf();
|
101
|
+
},
|
102
|
+
|
103
|
+
"regexp": function (b, a) {
|
104
|
+
return hoozit(b) === "regexp" &&
|
105
|
+
a.source === b.source && // the regex itself
|
106
|
+
a.global === b.global && // and its modifers (gmi) ...
|
107
|
+
a.ignoreCase === b.ignoreCase &&
|
108
|
+
a.multiline === b.multiline;
|
109
|
+
},
|
110
|
+
|
111
|
+
// - skip when the property is a method of an instance (OOP)
|
112
|
+
// - abort otherwise,
|
113
|
+
// initial === would have catch identical references anyway
|
114
|
+
"function": function () {
|
115
|
+
var caller = callers[callers.length - 1];
|
116
|
+
return caller !== Object &&
|
117
|
+
typeof caller !== "undefined";
|
118
|
+
},
|
119
|
+
|
120
|
+
"array": function (b, a) {
|
121
|
+
var i;
|
122
|
+
var len;
|
123
|
+
|
124
|
+
// b could be an object literal here
|
125
|
+
if ( ! (hoozit(b) === "array")) {
|
126
|
+
return false;
|
127
|
+
}
|
128
|
+
|
129
|
+
len = a.length;
|
130
|
+
if (len !== b.length) { // safe and faster
|
131
|
+
return false;
|
132
|
+
}
|
133
|
+
for (i = 0; i < len; i++) {
|
134
|
+
if( ! innerEquiv(a[i], b[i])) {
|
135
|
+
return false;
|
136
|
+
}
|
137
|
+
}
|
138
|
+
return true;
|
139
|
+
},
|
140
|
+
|
141
|
+
"object": function (b, a) {
|
142
|
+
var i;
|
143
|
+
var eq = true; // unless we can proove it
|
144
|
+
var aProperties = [], bProperties = []; // collection of strings
|
145
|
+
if (b===a) return true;
|
146
|
+
|
147
|
+
// comparing constructors is more strict than using instanceof
|
148
|
+
if ( a.constructor !== b.constructor) {
|
149
|
+
return false;
|
150
|
+
}
|
151
|
+
|
152
|
+
// stack constructor before traversing properties
|
153
|
+
callers.push(a.constructor);
|
154
|
+
|
155
|
+
for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
|
156
|
+
|
157
|
+
aProperties.push(i); // collect a's properties
|
158
|
+
|
159
|
+
if ( ! innerEquiv(a[i], b[i])) {
|
160
|
+
eq = false;
|
161
|
+
}
|
162
|
+
}
|
163
|
+
|
164
|
+
callers.pop(); // unstack, we are done
|
165
|
+
|
166
|
+
for (i in b) {
|
167
|
+
bProperties.push(i); // collect b's properties
|
168
|
+
}
|
169
|
+
|
170
|
+
// Ensures identical properties name
|
171
|
+
return eq && innerEquiv(aProperties.sort(), bProperties.sort());
|
172
|
+
}
|
173
|
+
};
|
174
|
+
}();
|
175
|
+
|
176
|
+
innerEquiv = function () { // can take multiple arguments
|
177
|
+
var args = Array.prototype.slice.apply(arguments);
|
178
|
+
if (args.length < 2) {
|
179
|
+
return true; // end transition
|
180
|
+
}
|
181
|
+
|
182
|
+
return (function (a, b) {
|
183
|
+
if (a === b) {
|
184
|
+
return true; // catch the most you can
|
185
|
+
|
186
|
+
} else if (typeof a !== typeof b || a === null || b === null || typeof a === "undefined" || typeof b === "undefined") {
|
187
|
+
return false; // don't lose time with error prone cases
|
188
|
+
|
189
|
+
} else if (b && b.isEqual && b.isEqual instanceof Function) {
|
190
|
+
return b.isEqual(a);
|
191
|
+
|
192
|
+
} else {
|
193
|
+
return bindCallbacks(a, callbacks, [b, a]);
|
194
|
+
}
|
195
|
+
|
196
|
+
// apply transition with (1..n) arguments
|
197
|
+
})(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length -1));
|
198
|
+
};
|
199
|
+
|
200
|
+
return innerEquiv;
|
201
|
+
}(); // equiv
|
@@ -0,0 +1,691 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore Costello - Property Observing Library
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// Portions ©2008-2009 Apple, Inc. All rights reserved.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
/*globals CoreTest Q$ */
|
9
|
+
|
10
|
+
sc_require('jquery');
|
11
|
+
|
12
|
+
/** @class
|
13
|
+
|
14
|
+
A test plan contains a set of functions that will be executed in order. The
|
15
|
+
results will be recorded into a results hash as well as calling a delegate.
|
16
|
+
|
17
|
+
When you define tests and modules, you are adding to the active test plan.
|
18
|
+
The test plan is then run when the page has finished loading.
|
19
|
+
|
20
|
+
Normally you will not need to work with a test plan directly, though if you
|
21
|
+
are writing a test runner application that needs to monitor test progress
|
22
|
+
you may write a delegate to talk to the test plan.
|
23
|
+
|
24
|
+
The CoreTest.Plan.fn hash contains functions that will be made global via
|
25
|
+
wrapper methods. The methods must accept a Plan object as their first
|
26
|
+
parameter.
|
27
|
+
|
28
|
+
h2. Results
|
29
|
+
|
30
|
+
The results hash contains a summary of the results of running the test
|
31
|
+
plan. It includes the following properties:
|
32
|
+
|
33
|
+
- *assertions* - the total number of assertions
|
34
|
+
- *tests* - the total number of tests
|
35
|
+
- *passed* - number of assertions that passed
|
36
|
+
- *failed* - number of assertions that failed
|
37
|
+
- *errors* - number of assertions with errors
|
38
|
+
- *warnings* - number of assertions with warnings
|
39
|
+
|
40
|
+
You can also consult the log property, which contains an array of hashes -
|
41
|
+
one for each assertion - with the following properties:
|
42
|
+
|
43
|
+
- *module* - module descriptions
|
44
|
+
- *test* - test description
|
45
|
+
- *message* - assertion description
|
46
|
+
- *result* - CoreTest.OK, CoreTest.FAILED, CoreTest.ERROR, CoreTest.WARN
|
47
|
+
|
48
|
+
@since SproutCore 1.0
|
49
|
+
*/
|
50
|
+
CoreTest.Plan = {
|
51
|
+
|
52
|
+
/**
|
53
|
+
Define a new test plan instance. Optionally pass attributes to apply
|
54
|
+
to the new plan object. Usually you will call this without arguments.
|
55
|
+
|
56
|
+
@param {Hash} attrs plan arguments
|
57
|
+
@returns {CoreTest.Plan} new instance/subclass
|
58
|
+
*/
|
59
|
+
create: function(attrs) {
|
60
|
+
var len = arguments.length,
|
61
|
+
ret = CoreTest.beget(this),
|
62
|
+
idx;
|
63
|
+
for(idx=0;idx<len;idx++) CoreTest.mixin(ret, attrs);
|
64
|
+
ret.queue = ret.queue.slice(); // want an independent queue
|
65
|
+
return ret ;
|
66
|
+
},
|
67
|
+
|
68
|
+
// ..........................................................
|
69
|
+
// RUNNING
|
70
|
+
//
|
71
|
+
|
72
|
+
/** @private - array of functions to execute in order. */
|
73
|
+
queue: [],
|
74
|
+
|
75
|
+
/**
|
76
|
+
If true then the test plan is currently running and items in the queue
|
77
|
+
will execute in order.
|
78
|
+
|
79
|
+
@type {Boolean}
|
80
|
+
*/
|
81
|
+
isRunning: false,
|
82
|
+
|
83
|
+
/**
|
84
|
+
Primitive used to add callbacks to the test plan queue. Usually you will
|
85
|
+
not want to call this method directly but instead use the module() or
|
86
|
+
test() methods.
|
87
|
+
|
88
|
+
@returns {CoreTest.Plan} receiver
|
89
|
+
*/
|
90
|
+
synchronize: function synchronize(callback) {
|
91
|
+
this.queue.push(callback);
|
92
|
+
if (this.isRunning) this.process(); // run queue
|
93
|
+
return this;
|
94
|
+
},
|
95
|
+
|
96
|
+
/**
|
97
|
+
Processes items in the queue as long as isRunning remained true. When
|
98
|
+
no further items are left in the queue, calls finish(). Usually you will
|
99
|
+
not call this method directly. Instead call run().
|
100
|
+
|
101
|
+
@returns {CoreTest.Plan} receiver
|
102
|
+
*/
|
103
|
+
process: function process() {
|
104
|
+
while(this.queue.length && this.isRunning) {
|
105
|
+
this.queue.shift().call(this);
|
106
|
+
}
|
107
|
+
return this ;
|
108
|
+
},
|
109
|
+
|
110
|
+
/**
|
111
|
+
Begins running the test plan after a slight delay to avoid interupting
|
112
|
+
any current callbacks.
|
113
|
+
|
114
|
+
@returns {CoreTest.Plan} receiver
|
115
|
+
*/
|
116
|
+
start: function() {
|
117
|
+
var plan = this ;
|
118
|
+
setTimeout(function() {
|
119
|
+
if (plan.timeout) clearTimeout(plan.timeout);
|
120
|
+
plan.timeout = null;
|
121
|
+
plan.isRunning = true;
|
122
|
+
plan.process();
|
123
|
+
}, 13);
|
124
|
+
return this ;
|
125
|
+
},
|
126
|
+
|
127
|
+
/**
|
128
|
+
Stops the test plan from running any further. If you pass a timeout,
|
129
|
+
it will raise an exception if the test plan does not begin executing
|
130
|
+
with the alotted timeout.
|
131
|
+
|
132
|
+
@param {Number} timeout optional timeout in msec
|
133
|
+
@returns {CoreTest.Plan} receiver
|
134
|
+
*/
|
135
|
+
stop: function(timeout) {
|
136
|
+
this.isRunning = false ;
|
137
|
+
|
138
|
+
if (this.timeout) clearTimeout(this.timeout);
|
139
|
+
if (timeout) {
|
140
|
+
var plan = this;
|
141
|
+
this.timeout = setTimeout(function() {
|
142
|
+
plan.fail("Test timed out").start();
|
143
|
+
}, timeout);
|
144
|
+
} else this.timeout = null ;
|
145
|
+
return this ;
|
146
|
+
},
|
147
|
+
|
148
|
+
/**
|
149
|
+
Force the test plan to take a break. Avoids slow script warnings. This
|
150
|
+
is called automatically after each test completes.
|
151
|
+
*/
|
152
|
+
pause: function() {
|
153
|
+
if (this.isRunning) {
|
154
|
+
var del = this.delegate;
|
155
|
+
if (del && del.planDidPause) del.planDidPause(this);
|
156
|
+
|
157
|
+
this.isRunning = false ;
|
158
|
+
this.start();
|
159
|
+
}
|
160
|
+
return this ;
|
161
|
+
},
|
162
|
+
|
163
|
+
/**
|
164
|
+
Initiates running the tests for the first time. This will add an item
|
165
|
+
to the queue to call finish() on the plan when the run completes.
|
166
|
+
|
167
|
+
@returns {CoreTest.Plan} receiver
|
168
|
+
*/
|
169
|
+
run: function() {
|
170
|
+
this.isRunning = true;
|
171
|
+
this.prepare();
|
172
|
+
|
173
|
+
// initialize new results
|
174
|
+
this.results = {
|
175
|
+
start: new Date().getTime(),
|
176
|
+
finish: null,
|
177
|
+
runtime: 0,
|
178
|
+
tests: 0,
|
179
|
+
total: 0,
|
180
|
+
passed: 0,
|
181
|
+
failed: 0,
|
182
|
+
errors: 0,
|
183
|
+
warnings: 0,
|
184
|
+
assertions: []
|
185
|
+
};
|
186
|
+
|
187
|
+
// add item to queue to finish running the test plan when finished.
|
188
|
+
this.begin().synchronize(this.finish).process();
|
189
|
+
|
190
|
+
return this ;
|
191
|
+
},
|
192
|
+
|
193
|
+
/**
|
194
|
+
Called when the test plan begins running. This method will notify the
|
195
|
+
delegate. You will not normally call this method directly.
|
196
|
+
|
197
|
+
@returns {CoreTest.Plan} receiver
|
198
|
+
*/
|
199
|
+
begin: function() {
|
200
|
+
var del = this.delegate;
|
201
|
+
if (del && del.planDidBegin) del.planDidBegin(this);
|
202
|
+
return this ;
|
203
|
+
},
|
204
|
+
|
205
|
+
/**
|
206
|
+
When the test plan finishes running, this method will be called to notify
|
207
|
+
the delegate that the plan as finished.
|
208
|
+
|
209
|
+
@returns {CoreTest.Plan} receiver
|
210
|
+
*/
|
211
|
+
finish: function() {
|
212
|
+
var r = this.results,
|
213
|
+
del = this.delegate;
|
214
|
+
|
215
|
+
r.finish = new Date().getTime();
|
216
|
+
r.runtime = r.finish - r.start;
|
217
|
+
|
218
|
+
if (del && del.planDidFinish) del.planDidFinish(this, r);
|
219
|
+
return this ;
|
220
|
+
},
|
221
|
+
|
222
|
+
/**
|
223
|
+
Sets the current module information. This will be used when a test is
|
224
|
+
added under the module.
|
225
|
+
|
226
|
+
@returns {CoreTest.Plan} receiver
|
227
|
+
*/
|
228
|
+
module: function(desc, lifecycle) {
|
229
|
+
this.currentModule = desc;
|
230
|
+
|
231
|
+
if (!lifecycle) lifecycle = {};
|
232
|
+
this.setup(lifecycle.setup).teardown(lifecycle.teardown);
|
233
|
+
|
234
|
+
return this ;
|
235
|
+
},
|
236
|
+
|
237
|
+
/**
|
238
|
+
Sets the current setup method.
|
239
|
+
|
240
|
+
@returns {CoreTest.Plan} receiver
|
241
|
+
*/
|
242
|
+
setup: function(func) {
|
243
|
+
this.currentSetup = func || CoreTest.K;
|
244
|
+
return this;
|
245
|
+
},
|
246
|
+
|
247
|
+
/**
|
248
|
+
Sets the current teardown method
|
249
|
+
|
250
|
+
@returns {CoreTest.Plan} receiver
|
251
|
+
*/
|
252
|
+
teardown: function teardown(func) {
|
253
|
+
this.currentTeardown = func || CoreTest.K ;
|
254
|
+
return this;
|
255
|
+
},
|
256
|
+
|
257
|
+
now: function() { return new Date().getTime(); },
|
258
|
+
|
259
|
+
/**
|
260
|
+
Generates a unit test, adding it to the test plan.
|
261
|
+
*/
|
262
|
+
test: function test(desc, func) {
|
263
|
+
|
264
|
+
if (!this.enabled(this.currentModule, desc)) return this; // skip
|
265
|
+
|
266
|
+
// base prototype describing test
|
267
|
+
var working = {
|
268
|
+
module: this.currentModule,
|
269
|
+
test: desc,
|
270
|
+
expected: 0,
|
271
|
+
assertions: []
|
272
|
+
};
|
273
|
+
|
274
|
+
var msg;
|
275
|
+
var name = desc ;
|
276
|
+
if (this.currentModule) name = this.currentModule + " module: " + name;
|
277
|
+
|
278
|
+
var setup = this.currentSetup || CoreTest.K;
|
279
|
+
var teardown = this.currentTeardown || CoreTest.K;
|
280
|
+
|
281
|
+
// add setup to queue
|
282
|
+
this.synchronize(function() {
|
283
|
+
|
284
|
+
// save main fixture...
|
285
|
+
var mainEl = document.getElementById('main');
|
286
|
+
this.fixture = mainEl ? mainEl.innerHTML : '';
|
287
|
+
mainEl = null;
|
288
|
+
|
289
|
+
this.working = working;
|
290
|
+
|
291
|
+
try {
|
292
|
+
working.total_begin = working.setup_begin = this.now();
|
293
|
+
setup.call(this);
|
294
|
+
working.setup_end = this.now();
|
295
|
+
} catch(e) {
|
296
|
+
msg = (e && e.toString) ? e.toString() : "(unknown error)";
|
297
|
+
this.error("Setup exception on " + name + ": " + msg);
|
298
|
+
}
|
299
|
+
});
|
300
|
+
|
301
|
+
// now actually invoke test
|
302
|
+
this.synchronize(function() {
|
303
|
+
if (!func) {
|
304
|
+
this.warn("Test not yet implemented: " + name);
|
305
|
+
} else {
|
306
|
+
try {
|
307
|
+
if (CoreTest.trace) console.log("run: " + name);
|
308
|
+
this.working.test_begin = this.now();
|
309
|
+
func.call(this);
|
310
|
+
this.working.test_end = this.now();
|
311
|
+
} catch(e) {
|
312
|
+
msg = (e && e.toString) ? e.toString() : "(unknown error)";
|
313
|
+
this.error("Died on test #" + (this.working.assertions.length + 1) + ": " + msg);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
});
|
317
|
+
|
318
|
+
// cleanup
|
319
|
+
this.synchronize(function() {
|
320
|
+
try {
|
321
|
+
this.working.teardown_begin = this.now();
|
322
|
+
teardown.call(this);
|
323
|
+
this.working.teardown_end = this.now();
|
324
|
+
} catch(e) {
|
325
|
+
msg = (e && e.toString) ? e.toString() : "(unknown error)";
|
326
|
+
this.error("Teardown exception on " + name + ": " + msg);
|
327
|
+
}
|
328
|
+
});
|
329
|
+
|
330
|
+
// finally, reset and report result
|
331
|
+
this.synchronize(function() {
|
332
|
+
|
333
|
+
if (this.reset) {
|
334
|
+
try {
|
335
|
+
this.working.reset_begin = this.now();
|
336
|
+
this.reset();
|
337
|
+
this.working.total_end = this.working.reset_end = this.now();
|
338
|
+
} catch(ex) {
|
339
|
+
msg = (ex && ex.toString) ? ex.toString() : "(unknown error)";
|
340
|
+
this.error("Reset exception on " + name + ": " + msg) ;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
|
344
|
+
// check for expected assertions
|
345
|
+
var w = this.working,
|
346
|
+
exp = w.expected,
|
347
|
+
len = w.assertions.length;
|
348
|
+
|
349
|
+
if (exp && exp !== len) {
|
350
|
+
this.fail("Expected " + exp + " assertions, but " + len + " were run");
|
351
|
+
}
|
352
|
+
|
353
|
+
// finally, record result
|
354
|
+
this.working = null;
|
355
|
+
this.record(w.module, w.test, w.assertions, w);
|
356
|
+
|
357
|
+
if (!this.pauseTime) {
|
358
|
+
this.pauseTime = new Date().getTime();
|
359
|
+
} else {
|
360
|
+
var now = new Date().getTime();
|
361
|
+
if ((now - this.pauseTime) > 250) {
|
362
|
+
this.pause();
|
363
|
+
this.pauseTime = now ;
|
364
|
+
}
|
365
|
+
}
|
366
|
+
|
367
|
+
});
|
368
|
+
},
|
369
|
+
|
370
|
+
/**
|
371
|
+
Converts the passed string into HTML and then appends it to the main body
|
372
|
+
element. This is a useful way to automatically load fixture HTML into the
|
373
|
+
main page.
|
374
|
+
*/
|
375
|
+
htmlbody: function htmlbody(string) {
|
376
|
+
this.synchronize(function() {
|
377
|
+
var html = Q$(string) ;
|
378
|
+
var body = Q$('body')[0];
|
379
|
+
|
380
|
+
// first, find the first element with id 'htmlbody-begin' if exists,
|
381
|
+
// remove everything after that to reset...
|
382
|
+
var begin = Q$('body #htmlbody-begin')[0];
|
383
|
+
if (!begin) {
|
384
|
+
begin = Q$('<div id="htmlbody-begin"></div>')[0];
|
385
|
+
body.appendChild(begin);
|
386
|
+
} else {
|
387
|
+
while(begin.nextSibling) body.removeChild(begin.nextSibling);
|
388
|
+
}
|
389
|
+
begin = null;
|
390
|
+
|
391
|
+
// now append new content
|
392
|
+
html.each(function() { body.appendChild(this); });
|
393
|
+
}) ;
|
394
|
+
},
|
395
|
+
|
396
|
+
/**
|
397
|
+
Records the results of a test. This will add the results to the log
|
398
|
+
and notify the delegate. The passed assertions array should contain
|
399
|
+
hashes with the result and message.
|
400
|
+
*/
|
401
|
+
record: function(module, test, assertions, timings) {
|
402
|
+
var r = this.results,
|
403
|
+
len = assertions.length,
|
404
|
+
del = this.delegate,
|
405
|
+
idx, cur;
|
406
|
+
|
407
|
+
r.tests++;
|
408
|
+
for(idx=0;idx<len;idx++) {
|
409
|
+
cur = assertions[idx];
|
410
|
+
cur.module = module;
|
411
|
+
cur.test = test ;
|
412
|
+
|
413
|
+
r.total++;
|
414
|
+
r[cur.result]++;
|
415
|
+
r.assertions.push(cur);
|
416
|
+
}
|
417
|
+
|
418
|
+
if (del && del.planDidRecord) {
|
419
|
+
del.planDidRecord(this, module, test, assertions, timings) ;
|
420
|
+
}
|
421
|
+
|
422
|
+
},
|
423
|
+
|
424
|
+
/**
|
425
|
+
Universal method can be called to reset the global state of the
|
426
|
+
application for each test. The default implementation will reset any
|
427
|
+
saved fixture.
|
428
|
+
*/
|
429
|
+
reset: function() {
|
430
|
+
if (this.fixture) {
|
431
|
+
var mainEl = document.getElementById('main');
|
432
|
+
if (mainEl) mainEl.innerHTML = this.fixture;
|
433
|
+
mainEl = null;
|
434
|
+
}
|
435
|
+
return this ;
|
436
|
+
},
|
437
|
+
|
438
|
+
/**
|
439
|
+
Can be used to decide if a particular test should be enabled or not.
|
440
|
+
Current implementation allows a test to run.
|
441
|
+
|
442
|
+
@returns {Boolean}
|
443
|
+
*/
|
444
|
+
enabled: function(moduleName, testName) {
|
445
|
+
return true;
|
446
|
+
},
|
447
|
+
|
448
|
+
// ..........................................................
|
449
|
+
// MATCHERS
|
450
|
+
//
|
451
|
+
|
452
|
+
/**
|
453
|
+
Called by a matcher to record that a test has passed. Requires a working
|
454
|
+
test property.
|
455
|
+
*/
|
456
|
+
pass: function(msg) {
|
457
|
+
var w = this.working ;
|
458
|
+
if (!w) throw "pass("+msg+") called outside of a working test";
|
459
|
+
w.assertions.push({ message: msg, result: CoreTest.OK });
|
460
|
+
return this ;
|
461
|
+
},
|
462
|
+
|
463
|
+
/**
|
464
|
+
Called by a matcher to record that a test has failed. Requires a working
|
465
|
+
test property.
|
466
|
+
*/
|
467
|
+
fail: function(msg) {
|
468
|
+
var w = this.working ;
|
469
|
+
if (!w) throw "fail("+msg+") called outside of a working test";
|
470
|
+
w.assertions.push({ message: msg, result: CoreTest.FAIL });
|
471
|
+
return this ;
|
472
|
+
},
|
473
|
+
|
474
|
+
/**
|
475
|
+
Called by a matcher to record that a test issued a warning. Requires a
|
476
|
+
working test property.
|
477
|
+
*/
|
478
|
+
warn: function(msg) {
|
479
|
+
var w = this.working ;
|
480
|
+
if (!w) throw "warn("+msg+") called outside of a working test";
|
481
|
+
w.assertions.push({ message: msg, result: CoreTest.WARN });
|
482
|
+
return this ;
|
483
|
+
},
|
484
|
+
|
485
|
+
/**
|
486
|
+
Called by a matcher to record that a test had an error. Requires a
|
487
|
+
working test property.
|
488
|
+
*/
|
489
|
+
error: function(msg, e) {
|
490
|
+
var w = this.working ;
|
491
|
+
if (!w) throw "error("+msg+") called outside of a working test";
|
492
|
+
|
493
|
+
if(e && typeof console != "undefined" && console.error && console.warn ) {
|
494
|
+
console.error(msg);
|
495
|
+
console.error(e);
|
496
|
+
}
|
497
|
+
|
498
|
+
w.assertions.push({ message: msg, result: CoreTest.ERROR });
|
499
|
+
return this ;
|
500
|
+
},
|
501
|
+
|
502
|
+
/**
|
503
|
+
Any methods added to this hash will be made global just before the first
|
504
|
+
test is run. You can add new methods to this hash to use them in unit
|
505
|
+
tests. "this" will always be the test plan.
|
506
|
+
*/
|
507
|
+
fn: {
|
508
|
+
|
509
|
+
/**
|
510
|
+
Primitive will pass or fail the test based on the first boolean. If you
|
511
|
+
pass an actual and expected value, then this will automatically log the
|
512
|
+
actual and expected values. Otherwise, it will expect the message to
|
513
|
+
be passed as the second argument.
|
514
|
+
|
515
|
+
@param {Boolean} pass true if pass
|
516
|
+
@param {Object} actual optional actual
|
517
|
+
@param {Object} expected optional expected
|
518
|
+
@param {String} msg optional message
|
519
|
+
@returns {CoreTest.Plan} receiver
|
520
|
+
*/
|
521
|
+
ok: function ok(pass, actual, expected, msg) {
|
522
|
+
if (msg === undefined) {
|
523
|
+
msg = actual ;
|
524
|
+
if (!msg) msg = pass ? "OK" : "failed";
|
525
|
+
} else {
|
526
|
+
if (!msg) msg = pass ? "OK" : "failed";
|
527
|
+
if (pass) {
|
528
|
+
msg = msg + ": " + CoreTest.dump(expected) ;
|
529
|
+
} else {
|
530
|
+
msg = msg + ", expected: " + CoreTest.dump(expected) + " result: " + CoreTest.dump(actual);
|
531
|
+
}
|
532
|
+
}
|
533
|
+
return !!pass ? this.pass(msg) : this.fail(msg);
|
534
|
+
},
|
535
|
+
|
536
|
+
/**
|
537
|
+
Primitive performs a basic equality test on the passed values. Prints
|
538
|
+
out both actual and expected values.
|
539
|
+
|
540
|
+
Preferred to ok(actual === expected, message);
|
541
|
+
|
542
|
+
@param {Object} actual tested object
|
543
|
+
@param {Object} expected expected value
|
544
|
+
@param {String} msg optional message
|
545
|
+
@returns {CoreTest.Plan} receiver
|
546
|
+
*/
|
547
|
+
equals: function equals(actual, expected, msg) {
|
548
|
+
if (msg === undefined) msg = null; // make sure ok logs properly
|
549
|
+
return this.ok(actual == expected, actual, expected, msg);
|
550
|
+
},
|
551
|
+
|
552
|
+
/**
|
553
|
+
Expects the passed function call to throw an exception of the given
|
554
|
+
type. If you pass null or Error for the expected exception, this will
|
555
|
+
pass if any error is received. If you pass a string, this will check
|
556
|
+
message property of the exception.
|
557
|
+
|
558
|
+
@param {Function} callback the function to execute
|
559
|
+
@param {Error} expected optional, the expected error
|
560
|
+
@param {String} a description
|
561
|
+
@returns {CoreTest.Plan} receiver
|
562
|
+
*/
|
563
|
+
should_throw: function should_throw(callback, expected, msg) {
|
564
|
+
var actual = false ;
|
565
|
+
|
566
|
+
try {
|
567
|
+
callback();
|
568
|
+
} catch(e) {
|
569
|
+
actual = (typeof expected === "string") ? e.message : e;
|
570
|
+
}
|
571
|
+
|
572
|
+
if (expected===false) {
|
573
|
+
ok(actual===false, CoreTest.fmt("%@ expected no exception, actual %@", msg, actual));
|
574
|
+
} else if (expected===Error || expected===null || expected===true) {
|
575
|
+
ok(!!actual, CoreTest.fmt("%@ expected exception, actual %@", msg, actual));
|
576
|
+
} else {
|
577
|
+
equals(actual, expected, msg);
|
578
|
+
}
|
579
|
+
},
|
580
|
+
|
581
|
+
/**
|
582
|
+
Specify the number of expected assertions to gaurantee that a failed
|
583
|
+
test (no assertions are run at all) don't slip through
|
584
|
+
|
585
|
+
@returns {CoreTest.Plan} receiver
|
586
|
+
*/
|
587
|
+
expect: function expect(asserts) {
|
588
|
+
this.working.expected = asserts;
|
589
|
+
},
|
590
|
+
|
591
|
+
/**
|
592
|
+
Verifies that two objects are actually the same. This method will do
|
593
|
+
a deep compare instead of a simple equivalence test. You should use
|
594
|
+
this instead of equals() when you expect the two object to be different
|
595
|
+
instances but to have the same content.
|
596
|
+
|
597
|
+
@param {Object} value tested object
|
598
|
+
@param {Object} actual expected value
|
599
|
+
@param {String} msg optional message
|
600
|
+
@returns {CoreTest.Plan} receiver
|
601
|
+
*/
|
602
|
+
same: function(actual, expected, msg) {
|
603
|
+
if (msg === undefined) msg = null ; // make sure ok logs properly
|
604
|
+
return this.ok(CoreTest.equiv(actual, expected), actual, expected, msg);
|
605
|
+
},
|
606
|
+
|
607
|
+
/**
|
608
|
+
Stops the current tests from running. An optional timeout will
|
609
|
+
automatically fail the test if it does not restart within the specified
|
610
|
+
period of time.
|
611
|
+
|
612
|
+
@param {Number} timeout timeout in msec
|
613
|
+
@returns {CoreTest.Plan} receiver
|
614
|
+
*/
|
615
|
+
stop: function(timeout) {
|
616
|
+
return this.stop(timeout);
|
617
|
+
},
|
618
|
+
|
619
|
+
/**
|
620
|
+
Restarts tests running. Use this to begin tests after you stop tests.
|
621
|
+
|
622
|
+
@returns {CoreTest.Plan} receiver
|
623
|
+
*/
|
624
|
+
start: function() {
|
625
|
+
return this.start();
|
626
|
+
},
|
627
|
+
|
628
|
+
reset: function() {
|
629
|
+
return this.reset();
|
630
|
+
}
|
631
|
+
|
632
|
+
},
|
633
|
+
|
634
|
+
/**
|
635
|
+
Exports the comparison functions into the global namespace. This will
|
636
|
+
allow you to call these methods from within testing functions. This
|
637
|
+
method is called automatically just before the first test is run.
|
638
|
+
|
639
|
+
@returns {CoreTest.Plan} receiver
|
640
|
+
*/
|
641
|
+
prepare: function() {
|
642
|
+
var fn = this.fn,
|
643
|
+
plan = this,
|
644
|
+
key, func;
|
645
|
+
|
646
|
+
for(key in fn) {
|
647
|
+
if (!fn.hasOwnProperty(key)) continue ;
|
648
|
+
func = fn[key];
|
649
|
+
if (typeof func !== "function") continue ;
|
650
|
+
window[key] = this._bind(func);
|
651
|
+
if (!plan[key]) plan[key] = func;
|
652
|
+
}
|
653
|
+
return this ;
|
654
|
+
},
|
655
|
+
|
656
|
+
_bind: function(func) {
|
657
|
+
var plan = this;
|
658
|
+
return function() { return func.apply(plan, arguments); };
|
659
|
+
}
|
660
|
+
|
661
|
+
};
|
662
|
+
|
663
|
+
// ..........................................................
|
664
|
+
// EXPORT BASIC API
|
665
|
+
//
|
666
|
+
|
667
|
+
CoreTest.defaultPlan = function defaultPlan() {
|
668
|
+
var plan = CoreTest.plan;
|
669
|
+
if (!plan) {
|
670
|
+
CoreTest.runner = CoreTest.Runner.create();
|
671
|
+
plan = CoreTest.plan = CoreTest.runner.plan;
|
672
|
+
}
|
673
|
+
return plan;
|
674
|
+
};
|
675
|
+
|
676
|
+
// create a module. If this is the first time, create the test plan and
|
677
|
+
// runner. This will cause the test to run on page load
|
678
|
+
window.module = function(desc, l) {
|
679
|
+
CoreTest.defaultPlan().module(desc, l);
|
680
|
+
};
|
681
|
+
|
682
|
+
// create a test. If this is the first time, create the test plan and
|
683
|
+
// runner. This will cause the test to run on page load
|
684
|
+
window.test = function(desc, func) {
|
685
|
+
CoreTest.defaultPlan().test(desc, func);
|
686
|
+
};
|
687
|
+
|
688
|
+
// reset htmlbody for unit testing
|
689
|
+
window.htmlbody = function(string) {
|
690
|
+
CoreTest.defaultPlan().htmlbody(string);
|
691
|
+
};
|