sproutit-sproutcore 1.0.0.20090407205609
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 +115 -0
- data/History.txt +7 -0
- data/README.txt +102 -0
- data/Rakefile +54 -0
- data/Todo.txt +1 -0
- data/bin/sc-build +13 -0
- data/bin/sc-build-number +13 -0
- data/bin/sc-gen +13 -0
- data/bin/sc-init +13 -0
- data/bin/sc-manifest +13 -0
- data/bin/sc-server +13 -0
- data/bin/sproutcore +14 -0
- data/buildtasks/build.rake +73 -0
- data/buildtasks/entry.rake +59 -0
- data/buildtasks/manifest.rake +469 -0
- data/buildtasks/render.rake +21 -0
- data/buildtasks/target.rake +42 -0
- data/gen/Buildfile +16 -0
- data/gen/app/Buildfile +36 -0
- data/gen/app/README +1 -0
- data/gen/app/USAGE +13 -0
- data/gen/app/templates/apps/{target_name}/core.js +27 -0
- data/gen/app/templates/apps/{target_name}/english.lproj/loading.rhtml +9 -0
- data/gen/app/templates/apps/{target_name}/english.lproj/main_page.js +22 -0
- data/gen/app/templates/apps/{target_name}/english.lproj/strings.js +15 -0
- data/gen/app/templates/apps/{target_name}/main.js +30 -0
- data/gen/controller/Buildfile +18 -0
- data/gen/controller/README +1 -0
- data/gen/controller/USAGE +13 -0
- data/gen/controller/templates/controllers/{filename}.js +18 -0
- data/gen/controller/templates/tests/controllers/{filename}.js +15 -0
- data/gen/framework/Buildfile +36 -0
- data/gen/framework/README +1 -0
- data/gen/framework/USAGE +13 -0
- data/gen/framework/templates/frameworks/{target_name}/core.js +21 -0
- data/gen/framework/templates/frameworks/{target_name}/english.lproj/strings.js +15 -0
- data/gen/language/Buildfile +26 -0
- data/gen/language/README +1 -0
- data/gen/language/USAGE +13 -0
- data/gen/language/templates/{filename}/strings.js +14 -0
- data/gen/model/Buildfile +16 -0
- data/gen/model/README +1 -0
- data/gen/model/USAGE +15 -0
- data/gen/model/templates/fixtures/{filename}.js +35 -0
- data/gen/model/templates/models/{filename}.js +19 -0
- data/gen/model/templates/tests/models/{filename}.js +15 -0
- data/gen/project/Buildfile +45 -0
- data/gen/project/INIT +3 -0
- data/gen/project/README +1 -0
- data/gen/project/USAGE +2 -0
- data/gen/project/templates/{filename}/Buildfile +7 -0
- data/gen/project/templates/{filename}/README +7 -0
- data/gen/test/Buildfile +25 -0
- data/gen/test/README +1 -0
- data/gen/test/USAGE +12 -0
- data/gen/test/templates/tests/{filename}.js +15 -0
- data/gen/theme/Buildfile +36 -0
- data/gen/theme/README +1 -0
- data/gen/theme/USAGE +13 -0
- data/gen/theme/templates/themes/{target_name}/english.lproj/strings.js +15 -0
- data/gen/view/Buildfile +18 -0
- data/gen/view/README +1 -0
- data/gen/view/USAGE +13 -0
- data/gen/view/templates/tests/views/{filename}.js +15 -0
- data/gen/view/templates/views/{filename}.js +18 -0
- data/lib/sproutcore.rb +130 -0
- data/lib/sproutcore/builders/base.rb +79 -0
- data/lib/sproutcore/builders/combine.rb +37 -0
- data/lib/sproutcore/builders/html.rb +177 -0
- data/lib/sproutcore/builders/javascript.rb +55 -0
- data/lib/sproutcore/builders/minify.rb +67 -0
- data/lib/sproutcore/builders/sass.rb +55 -0
- data/lib/sproutcore/builders/strings.rb +44 -0
- data/lib/sproutcore/builders/stylesheet.rb +40 -0
- data/lib/sproutcore/builders/test.rb +58 -0
- data/lib/sproutcore/builders/test_index.rb +26 -0
- data/lib/sproutcore/buildfile.rb +483 -0
- data/lib/sproutcore/buildfile/build_task.rb +33 -0
- data/lib/sproutcore/buildfile/buildfile_dsl.rb +162 -0
- data/lib/sproutcore/buildfile/cloneable.rb +34 -0
- data/lib/sproutcore/buildfile/early_time.rb +29 -0
- data/lib/sproutcore/buildfile/invocation_chain.rb +64 -0
- data/lib/sproutcore/buildfile/namespace.rb +33 -0
- data/lib/sproutcore/buildfile/string_ext.rb +198 -0
- data/lib/sproutcore/buildfile/task.rb +304 -0
- data/lib/sproutcore/buildfile/task_arguments.rb +86 -0
- data/lib/sproutcore/buildfile/task_manager.rb +193 -0
- data/lib/sproutcore/deprecated/view_helper.rb +662 -0
- data/lib/sproutcore/helpers/capture_helper.rb +30 -0
- data/lib/sproutcore/helpers/cssmin.rb +202 -0
- data/lib/sproutcore/helpers/dom_id_helper.rb +21 -0
- data/lib/sproutcore/helpers/entry_sorter.rb +105 -0
- data/lib/sproutcore/helpers/packed_optimizer.rb +102 -0
- data/lib/sproutcore/helpers/static_helper.rb +268 -0
- data/lib/sproutcore/helpers/tag_helper.rb +117 -0
- data/lib/sproutcore/helpers/text_helper.rb +303 -0
- data/lib/sproutcore/models/generator.rb +493 -0
- data/lib/sproutcore/models/hash_struct.rb +109 -0
- data/lib/sproutcore/models/manifest.rb +342 -0
- data/lib/sproutcore/models/manifest_entry.rb +232 -0
- data/lib/sproutcore/models/project.rb +270 -0
- data/lib/sproutcore/models/target.rb +403 -0
- data/lib/sproutcore/rack/builder.rb +269 -0
- data/lib/sproutcore/rack/dev.rb +51 -0
- data/lib/sproutcore/rack/docs.rb +24 -0
- data/lib/sproutcore/rack/proxy.rb +92 -0
- data/lib/sproutcore/rack/service.rb +141 -0
- data/lib/sproutcore/rack/test_runner.rb +24 -0
- data/lib/sproutcore/render_engines/erubis.rb +55 -0
- data/lib/sproutcore/render_engines/haml.rb +39 -0
- data/lib/sproutcore/tools.rb +311 -0
- data/lib/sproutcore/tools/build.rb +80 -0
- data/lib/sproutcore/tools/build_number.rb +23 -0
- data/lib/sproutcore/tools/gen.rb +99 -0
- data/lib/sproutcore/tools/init.rb +40 -0
- data/lib/sproutcore/tools/manifest.rb +84 -0
- data/lib/sproutcore/tools/server.rb +45 -0
- data/spec/buildtasks/build/copy_spec.rb +60 -0
- data/spec/buildtasks/build/spec_helper.rb +36 -0
- data/spec/buildtasks/manifest/catalog_spec.rb +48 -0
- data/spec/buildtasks/manifest/hide_buildfiles_spec.rb +125 -0
- data/spec/buildtasks/manifest/localize_spec.rb +97 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/combine_spec.rb +246 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/css_spec.rb +87 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/html_spec.rb +175 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/javascript_spec.rb +65 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/minify_spec.rb +70 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/packed_spec.rb +152 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/sass_spec.rb +98 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/strings_spec.rb +64 -0
- data/spec/buildtasks/manifest/prepare_build_tasks/tests_spec.rb +163 -0
- data/spec/buildtasks/manifest/prepare_spec.rb +43 -0
- data/spec/buildtasks/manifest/spec_helper.rb +35 -0
- data/spec/buildtasks/target_spec.rb +214 -0
- data/spec/fixtures/builder_tests/Buildfile +15 -0
- data/spec/fixtures/builder_tests/apps/combine_test/a.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/b.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/c.js +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/a.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/b.css +1 -0
- data/spec/fixtures/builder_tests/apps/combine_test/english.lproj/c.css +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/bar1_sample.rhtml +2 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/erb_sample.html.erb +1 -0
- 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 +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/english.lproj/strings.js +4 -0
- 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 +4 -0
- data/spec/fixtures/builder_tests/apps/html_test/lib/layout_template.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/html_test/scripts.js +0 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_static.js +15 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/sc_super.js +4 -0
- data/spec/fixtures/builder_tests/apps/javascript_test/strings.js +7 -0
- data/spec/fixtures/builder_tests/apps/sass_test/sample.sass +3 -0
- data/spec/fixtures/builder_tests/apps/strings_test/lproj/strings.js +8 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/build_directives.css +9 -0
- data/spec/fixtures/builder_tests/apps/stylesheet_test/sc_static.css +12 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/alt_layout.rhtml +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/lib/test_layout.rhtml +3 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/qunit_test2.js +1 -0
- data/spec/fixtures/builder_tests/apps/test_test/tests/rhtml_test.rhtml +4 -0
- 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 +4 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_1/english.lproj/test.rhtml +1 -0
- 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 +1 -0
- data/spec/fixtures/builder_tests/frameworks/req_target_2/javascript.js +1 -0
- 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 +1 -0
- data/spec/fixtures/buildfiles/basic/Buildfile +16 -0
- data/spec/fixtures/buildfiles/basic/task_module.rake +6 -0
- data/spec/fixtures/buildfiles/installed/Buildfile +7 -0
- data/spec/fixtures/buildfiles/installed/Buildfile2 +5 -0
- data/spec/fixtures/buildfiles/project_test/Buildfile +4 -0
- data/spec/fixtures/buildfiles/project_test/not_project/Buildfile +2 -0
- data/spec/fixtures/buildfiles/project_test/not_project/child/PLACEHOLDER +0 -0
- data/spec/fixtures/entry_for_project/Buildfile +1 -0
- data/spec/fixtures/entry_for_project/apps/test_app/entry.txt +0 -0
- 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 +8 -0
- 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 +5 -0
- 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 +8 -0
- data/spec/fixtures/find_targets/nested/apps/app1/Buildfile +1 -0
- 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 +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/B.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/a/b.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/b/a.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/c.js +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/core.js +1 -0
- 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 +1 -0
- data/spec/fixtures/ordered_entries/apps/no_requires/utils.js +1 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/a.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/b.js +3 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/c.js +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/a.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/b.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/c.css +2 -0
- data/spec/fixtures/ordered_entries/apps/with_requires/english.lproj/d.js +1 -0
- data/spec/fixtures/real_world/Buildfile +12 -0
- data/spec/fixtures/real_world/apps/account/README +1 -0
- data/spec/fixtures/real_world/apps/calendar/README +1 -0
- data/spec/fixtures/real_world/apps/contacts/README_BEFORE_EDITING +1 -0
- data/spec/fixtures/real_world/apps/files/README +1 -0
- data/spec/fixtures/real_world/apps/mail/README +1 -0
- data/spec/fixtures/real_world/apps/mobile_photos/README +1 -0
- data/spec/fixtures/real_world/apps/photos/README +1 -0
- data/spec/fixtures/real_world/apps/uploader/README +1 -0
- 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 +26 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/README +1 -0
- 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 +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/demo.html +1 -0
- 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 +1 -0
- 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 +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_require.css +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/no_sc_resource.rhtml +1 -0
- 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 +6 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/sc_resource.rhtml +3 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/english.lproj/strings.js +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +4 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/lib/index.html +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/no_require.js +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/protocols/sample.js +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/sc_resource.js +6 -0
- 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 +1 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/themes/standard_theme/README +0 -0
- data/spec/fixtures/real_world/frameworks/sproutcore/views/view.js +1 -0
- data/spec/fixtures/real_world/generators/sample_custom/Buildfile +0 -0
- data/spec/fixtures/real_world/generators/sample_custom/templates/{filename}.js +1 -0
- data/spec/fixtures/recursive_project/Buildfile +8 -0
- data/spec/fixtures/recursive_project/frameworks/sproutcore/frameworks/costello/PLACEHOLDER +0 -0
- data/spec/lib/builders/combine_spec.rb +67 -0
- data/spec/lib/builders/html_spec.rb +577 -0
- data/spec/lib/builders/javascript_spec.rb +81 -0
- data/spec/lib/builders/sass_spec.rb +43 -0
- data/spec/lib/builders/spec_helper.rb +30 -0
- data/spec/lib/builders/strings_spec.rb +52 -0
- data/spec/lib/builders/stylesheet_spec.rb +63 -0
- data/spec/lib/builders/test_index_spec.rb +44 -0
- data/spec/lib/builders/test_spec.rb +135 -0
- data/spec/lib/buildfile/config_for_spec.rb +81 -0
- data/spec/lib/buildfile/define_spec.rb +59 -0
- data/spec/lib/buildfile/dup_spec.rb +65 -0
- data/spec/lib/buildfile/invoke_spec.rb +130 -0
- data/spec/lib/buildfile/load_spec.rb +49 -0
- data/spec/lib/buildfile/task/dup_spec.rb +55 -0
- data/spec/lib/buildfile/task_defined_spec.rb +17 -0
- data/spec/lib/buildfile_commands/build_task_spec.rb +19 -0
- data/spec/lib/buildfile_commands/config_spec.rb +97 -0
- data/spec/lib/buildfile_commands/import_spec.rb +17 -0
- data/spec/lib/buildfile_commands/namespace_spec.rb +18 -0
- data/spec/lib/buildfile_commands/proxies_spec.rb +38 -0
- data/spec/lib/buildfile_commands/replace_task_spec.rb +29 -0
- data/spec/lib/buildfile_commands/task_spec.rb +36 -0
- data/spec/lib/helpers/packing_optimizer/optimize_spec.rb +26 -0
- data/spec/lib/models/hash_struct/deep_clone_spec.rb +27 -0
- data/spec/lib/models/hash_struct/has_options_spec.rb +32 -0
- data/spec/lib/models/hash_struct/hash_spec.rb +64 -0
- data/spec/lib/models/hash_struct/merge_spec.rb +26 -0
- data/spec/lib/models/hash_struct/method_missing.rb +41 -0
- data/spec/lib/models/manifest/add_entry_spec.rb +36 -0
- data/spec/lib/models/manifest/add_transform_spec.rb +90 -0
- data/spec/lib/models/manifest/build_spec.rb +78 -0
- data/spec/lib/models/manifest/entry_for_spec.rb +94 -0
- data/spec/lib/models/manifest/find_entry.rb +84 -0
- data/spec/lib/models/manifest/prepare_spec.rb +62 -0
- data/spec/lib/models/manifest_entry/cacheable_url_spec.rb +31 -0
- data/spec/lib/models/manifest_entry/prepare_spec.rb +54 -0
- data/spec/lib/models/project/add_target_spec.rb +44 -0
- data/spec/lib/models/project/buildfile_spec.rb +35 -0
- data/spec/lib/models/project/find_targets_for_spec.rb +77 -0
- data/spec/lib/models/project/load_nearest_project_spec.rb +23 -0
- data/spec/lib/models/project/target_for_spec.rb +33 -0
- data/spec/lib/models/project/targets_spec.rb +62 -0
- data/spec/lib/models/target/compute_build_number_spec.rb +125 -0
- data/spec/lib/models/target/config_spec.rb +30 -0
- data/spec/lib/models/target/expand_required_targets_spec.rb +48 -0
- data/spec/lib/models/target/installed_languages_spec.rb +47 -0
- data/spec/lib/models/target/lproj_for_spec.rb +38 -0
- data/spec/lib/models/target/manifest_for_spec.rb +42 -0
- data/spec/lib/models/target/parent_target_spec.rb +21 -0
- data/spec/lib/models/target/prepare_spec.rb +53 -0
- data/spec/lib/models/target/required_targets_spec.rb +119 -0
- data/spec/lib/models/target/target_for_spec.rb +56 -0
- data/spec/lib/tools/build_number_spec.rb +28 -0
- data/spec/lib/tools/gen_spec.rb +207 -0
- data/spec/lib/tools/tools_spec.rb +78 -0
- data/spec/spec_helper.rb +138 -0
- data/sproutcore.gemspec +47 -0
- data/vendor/github_gem_lint.rb +22 -0
- data/vendor/yui-compressor/yuicompressor-2.4.2.jar +0 -0
- metadata +1084 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
2
|
+
|
3
|
+
buildfile = nil
|
4
|
+
|
5
|
+
# This should return the merged config setting for the named options
|
6
|
+
describe SC::Buildfile, 'config_for' do
|
7
|
+
|
8
|
+
before do
|
9
|
+
@buildfile = SC::Buildfile.define do
|
10
|
+
|
11
|
+
# all - all
|
12
|
+
config :all,
|
13
|
+
:test1 => :all_all,
|
14
|
+
:test2 => :all_all,
|
15
|
+
:test3 => :all_all,
|
16
|
+
:test4 => :all_all
|
17
|
+
|
18
|
+
# debug - all
|
19
|
+
mode :debug do
|
20
|
+
config :all,
|
21
|
+
:test2 => :debug_all,
|
22
|
+
:test4 => :debug_all
|
23
|
+
end
|
24
|
+
|
25
|
+
mode :production do
|
26
|
+
config :all,
|
27
|
+
:test2 => :production_all,
|
28
|
+
:test4 => :production_all
|
29
|
+
end
|
30
|
+
|
31
|
+
# all - bundle
|
32
|
+
config :foo, :test3 => :all_foo, :test4 => :all_foo
|
33
|
+
config :bar, :test3 => :all_bar, :test4 => :all_bar
|
34
|
+
|
35
|
+
# debug - bundle
|
36
|
+
mode :debug do
|
37
|
+
config :foo, :test4 => :debug_foo
|
38
|
+
config :bar, :test4 => :debug_bar
|
39
|
+
end
|
40
|
+
|
41
|
+
mode :production do
|
42
|
+
config :foo, :test4 => :production_foo
|
43
|
+
config :bar, :test4 => :production_bar
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_config(target_key, mode_name)
|
51
|
+
target_name = target_key.to_s.sub /^([^\/])/,'/\1'
|
52
|
+
config = @buildfile.config_for(target_name, mode_name)
|
53
|
+
config.test1.should eql(:all_all)
|
54
|
+
config.test2.should eql("#{mode_name}_all".to_sym)
|
55
|
+
config.test3.should eql("all_#{target_key}".to_sym)
|
56
|
+
config.test4.should eql("#{mode_name}_#{target_key}".to_sym)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "config_for(all, all) should exclude all specific mode/bundle settings" do
|
60
|
+
test_config :all, :all
|
61
|
+
end
|
62
|
+
|
63
|
+
it "config_for(all, mode) should exclude specific bundle settings" do
|
64
|
+
test_config :all, :debug
|
65
|
+
test_config :all, :production
|
66
|
+
end
|
67
|
+
|
68
|
+
it "config_for(bundle, :all) should exclude specific mode settings" do
|
69
|
+
test_config :foo, :all
|
70
|
+
test_config :bar, :all
|
71
|
+
end
|
72
|
+
|
73
|
+
it "config_for(bundle,mode) should exclude other modes or bundles, but include all" do
|
74
|
+
test_config :foo, :debug
|
75
|
+
test_config :bar, :debug
|
76
|
+
test_config :foo, :production
|
77
|
+
test_config :bar, :production
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Buildfile, 'define' do
|
4
|
+
|
5
|
+
it "should return new buildfile with task defined in block" do
|
6
|
+
task_did_run = false
|
7
|
+
b = SC::Buildfile.define do
|
8
|
+
task :test_task do
|
9
|
+
task_did_run = true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
b.should_not be_nil
|
14
|
+
|
15
|
+
b.invoke :test_task
|
16
|
+
task_did_run.should be_true
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should inherit tasks defined by parent buildfile" do
|
20
|
+
task1_did_run = false
|
21
|
+
task2_did_run = false
|
22
|
+
|
23
|
+
a = SC::Buildfile.define do
|
24
|
+
task :test_task1 do
|
25
|
+
task1_did_run = true
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
b = a.dup.define! do
|
30
|
+
task :test_task2 => :test_task1 do
|
31
|
+
task2_did_run = true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
a.should_not be_nil
|
36
|
+
b.should_not be_nil
|
37
|
+
|
38
|
+
b.invoke :test_task2
|
39
|
+
task1_did_run.should be_true
|
40
|
+
task2_did_run.should be_true
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should eval a string if passed to instance version" do
|
44
|
+
|
45
|
+
# add accessor to test.
|
46
|
+
a = SC::Buildfile.new.define! do
|
47
|
+
def did_run; @did_run; end
|
48
|
+
end
|
49
|
+
|
50
|
+
# now try string eval...
|
51
|
+
a.define! "task :test_task1 do\n@did_run = true\nend"
|
52
|
+
|
53
|
+
a.invoke :test_task1
|
54
|
+
a.did_run.should be_true
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
2
|
+
|
3
|
+
# define a custom subclass of the task to make sure classes are copied
|
4
|
+
class CustomTestTask < SC::Buildfile::Task
|
5
|
+
attr_accessor :test_property
|
6
|
+
end
|
7
|
+
|
8
|
+
describe SC::Buildfile, 'dup' do
|
9
|
+
|
10
|
+
it "should clone tasks so that the new tasks belong to the new buildfile" do
|
11
|
+
a = SC::Buildfile.define do
|
12
|
+
task :foo
|
13
|
+
end
|
14
|
+
|
15
|
+
b = a.dup
|
16
|
+
|
17
|
+
a.lookup(:foo).application.should eql(a)
|
18
|
+
b.lookup(:foo).application.should eql(b)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should clone tasks, including any custom subclasses" do
|
22
|
+
a = SC::Buildfile.define do
|
23
|
+
t = define_task CustomTestTask, :foo
|
24
|
+
t.test_property = :bar
|
25
|
+
end
|
26
|
+
|
27
|
+
b = a.dup
|
28
|
+
|
29
|
+
a.lookup(:foo).class.should eql(CustomTestTask)
|
30
|
+
a.lookup(:foo).test_property.should eql(:bar)
|
31
|
+
|
32
|
+
b.lookup(:foo).class.should eql(CustomTestTask)
|
33
|
+
b.lookup(:foo).test_property.should eql(:bar)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should clone config" do
|
37
|
+
a = SC::Buildfile.define do
|
38
|
+
config :all, :foo => :foo
|
39
|
+
end
|
40
|
+
|
41
|
+
b = a.dup.define! do
|
42
|
+
config :all, :foo => :bar
|
43
|
+
end
|
44
|
+
|
45
|
+
a.configs.all.all.foo.should eql(:foo)
|
46
|
+
b.configs.all.all.foo.should eql(:bar)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should clone project_type" do
|
50
|
+
a = SC::Buildfile.define
|
51
|
+
a.project_type = :foo
|
52
|
+
|
53
|
+
a.dup.project_type.should eql(:foo)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should NOT clone the project? status (must be set per-instance)" do
|
57
|
+
a = SC::Buildfile.define
|
58
|
+
a.project!
|
59
|
+
a.project?.should be_true
|
60
|
+
|
61
|
+
a.dup.project?.should be_false
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
2
|
+
|
3
|
+
buildfile = nil
|
4
|
+
task_result = nil
|
5
|
+
|
6
|
+
describe SC::Buildfile, 'invoke' do
|
7
|
+
|
8
|
+
include SC::SpecHelpers
|
9
|
+
|
10
|
+
before do
|
11
|
+
buildfile = SC::Buildfile.define do
|
12
|
+
|
13
|
+
task :task1 do
|
14
|
+
task_result = :task1
|
15
|
+
end
|
16
|
+
|
17
|
+
task :task2 do
|
18
|
+
task_result = CONSTANT
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should execute a task everytime it is called; even if task has run" do
|
25
|
+
task_result = nil
|
26
|
+
buildfile.invoke :task1
|
27
|
+
task_result.should eql(:task1)
|
28
|
+
|
29
|
+
task_result = nil
|
30
|
+
buildfile.invoke :task1
|
31
|
+
task_result.should eql(:task1)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should set any constants passed in to second option" do
|
35
|
+
task_result = nil
|
36
|
+
buildfile.invoke :task2, :constant => :test1
|
37
|
+
task_result.should eql(:test1)
|
38
|
+
|
39
|
+
task_result = nil
|
40
|
+
buildfile.invoke :task2, :constant => :test2
|
41
|
+
task_result.should eql(:test2)
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
# Weird edge case -- if a global constant is already set with an equal
|
46
|
+
# value, make sure it is overwritten and restored anyway.
|
47
|
+
it "should overwrite & restore global constants regardles of value" do
|
48
|
+
|
49
|
+
# create two object instances with the same "value"
|
50
|
+
const1 = {}
|
51
|
+
const2 = {}
|
52
|
+
|
53
|
+
Kernel.const_reset(:CONSTANT, const1)
|
54
|
+
buildfile.invoke :task2, :constant => const2
|
55
|
+
|
56
|
+
# now add some keys so we can tell them apart...
|
57
|
+
const1[:foo] = :const1
|
58
|
+
const2[:foo] = :const2
|
59
|
+
|
60
|
+
CONSTANT[:foo].should eql(:const1)
|
61
|
+
task_result[:foo].should eql(:const2)
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "prerequisites" do
|
65
|
+
|
66
|
+
it "should invoke each prerequisite only once" do
|
67
|
+
results = {}
|
68
|
+
buildfile = SC::Buildfile.define do
|
69
|
+
|
70
|
+
task :a do
|
71
|
+
RESULTS[:a] = (RESULTS[:a] || 0) + 1
|
72
|
+
end
|
73
|
+
|
74
|
+
task :b => :a do
|
75
|
+
RESULTS[:b] = (RESULTS[:b] || 0) + 1
|
76
|
+
end
|
77
|
+
|
78
|
+
task :c => [:a, :b] do
|
79
|
+
RESULTS[:c] = (RESULTS[:c] || 0) + 1
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
buildfile.invoke :c, :results => results
|
84
|
+
|
85
|
+
# task :A should have executed only once even though it is a pre-req
|
86
|
+
# of both b & c
|
87
|
+
results[:a].should eql(1)
|
88
|
+
results[:b].should == 1
|
89
|
+
results[:c].should == 1
|
90
|
+
end
|
91
|
+
|
92
|
+
it "should keep track of prereqs separately for each call to execute" do
|
93
|
+
results = {}
|
94
|
+
buildfile = SC::Buildfile.define do
|
95
|
+
|
96
|
+
task :a do
|
97
|
+
RESULTS[:a] = (RESULTS[:a] || 0) + 1
|
98
|
+
|
99
|
+
# Recursive call. Note that in regular Rake, this will reset the
|
100
|
+
# invocation chain and :a will get called too many times...
|
101
|
+
BUILDFILE.invoke :d
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
task :b => :a do
|
106
|
+
RESULTS[:b] = (RESULTS[:b] || 0) + 1
|
107
|
+
end
|
108
|
+
|
109
|
+
task :c => [:a, :b] do
|
110
|
+
RESULTS[:c] = (RESULTS[:c] || 0) + 1
|
111
|
+
end
|
112
|
+
|
113
|
+
task :d do
|
114
|
+
RESULTS[:d] = (RESULTS[:d] || 0) + 1
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
buildfile.invoke :c, :results => results, :buildfile => buildfile
|
120
|
+
|
121
|
+
# task :a should have executed twice because invoke() was invoked
|
122
|
+
# twice (once from within task :d)
|
123
|
+
results[:a].should eql(1)
|
124
|
+
results[:b].should == 1
|
125
|
+
results[:c].should == 1
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Buildfile, 'load' do
|
4
|
+
|
5
|
+
include SC::SpecHelpers
|
6
|
+
|
7
|
+
it "should load the contents of the buildfile as well as imports" do
|
8
|
+
p = fixture_path('buildfiles', 'basic', 'Buildfile')
|
9
|
+
b = SC::Buildfile.load(p)
|
10
|
+
|
11
|
+
b.should_not be_nil
|
12
|
+
b.invoke(:default)
|
13
|
+
|
14
|
+
# Found in Buildfile
|
15
|
+
RESULTS[:test_task1].should be_true
|
16
|
+
|
17
|
+
# Found in import(task_module)
|
18
|
+
RESULTS[:imported_task].should be_true
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should be able to load the contents of one builfile on top of another" do
|
22
|
+
a = SC::Buildfile.load(fixture_path('buildfiles','installed', 'Buildfile'))
|
23
|
+
b = a.dup.load! fixture_path('buildfiles','basic', 'Buildfile')
|
24
|
+
|
25
|
+
b.invoke :default
|
26
|
+
|
27
|
+
# Found in Buildfile
|
28
|
+
RESULTS[:test_task1].should be_true
|
29
|
+
|
30
|
+
# Found in installed/Buildfile
|
31
|
+
RESULTS[:installed_task].should be_true
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should store every loaded path in loaded_paths" do
|
35
|
+
## IMPORTANT! The buildfiles loaded here are not important, but they must
|
36
|
+
## not contain any 'import' directives or else this test will fail.
|
37
|
+
path1 = fixture_path('buildfiles','installed', 'Buildfile')
|
38
|
+
path2 = fixture_path('buildfiles','installed', 'Buildfile2')
|
39
|
+
|
40
|
+
a = SC::Buildfile.new
|
41
|
+
a.load! path1
|
42
|
+
a.load! path2
|
43
|
+
|
44
|
+
a.loaded_paths.size.should eql(2)
|
45
|
+
a.loaded_paths.should include(path1)
|
46
|
+
a.loaded_paths.should include(path2)
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. .. spec_helper])
|
2
|
+
|
3
|
+
# define a custom subclass of the task to make sure classes are copied
|
4
|
+
class CustomTestTask < SC::Buildfile::Task
|
5
|
+
attr_accessor :test_property
|
6
|
+
end
|
7
|
+
|
8
|
+
describe SC::Buildfile::Task, 'dup' do
|
9
|
+
|
10
|
+
before do
|
11
|
+
@app = SC::Buildfile.define # used to hook a buildtask
|
12
|
+
@task = SC::Buildfile::Task.new(:foo, @app)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should clone actions and prerequisites" do
|
16
|
+
@app.define! do
|
17
|
+
task :bar => :foo do
|
18
|
+
:test_action
|
19
|
+
end
|
20
|
+
end
|
21
|
+
@task = @app.lookup :bar
|
22
|
+
@task.actions.size.should eql(1) # check precondition
|
23
|
+
@task.prerequisites.size.should eql(1) # check precondition
|
24
|
+
|
25
|
+
action = @task.actions.first
|
26
|
+
pre = @task.prerequisites.first
|
27
|
+
|
28
|
+
task2 = @task.dup
|
29
|
+
task2.actions.size.should eql(1)
|
30
|
+
task2.actions.first.should eql(action)
|
31
|
+
|
32
|
+
task2.prerequisites.size.should eql(1)
|
33
|
+
task2.prerequisites.first.should eql(pre)
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should take passed application property if defined" do
|
38
|
+
app2 = SC::Buildfile.define
|
39
|
+
task2 = @task.dup(app2)
|
40
|
+
task2.application.should eql(app2)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should clone application property is not defined" do
|
44
|
+
@task.dup.application.should eql(@app)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should duplicate any ivars from subclasses" do
|
48
|
+
@task = CustomTestTask.new :foo, @app
|
49
|
+
@task.test_property = :bar
|
50
|
+
|
51
|
+
task2 = @task.dup
|
52
|
+
task2.test_property.should eql(:bar)
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), %w[.. .. spec_helper])
|
2
|
+
|
3
|
+
describe SC::Buildfile, 'task_defined?' do
|
4
|
+
|
5
|
+
it "should return true if the named task is defined" do
|
6
|
+
b = SC::Buildfile.new
|
7
|
+
b.define_task SC::Buildfile::Task, :test
|
8
|
+
b.task_defined?(:test).should be_true
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should return false if the named task is not defined" do
|
12
|
+
b = SC::Buildfile.new
|
13
|
+
b.task_defined?(:test).should be_false
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|