radiant 0.9.0.rc2 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +18 -6
- data/CONTRIBUTORS +7 -1
- data/INSTALL +0 -5
- data/README +21 -0
- data/app/controllers/admin/layouts_controller.rb +1 -0
- data/app/controllers/admin/preferences_controller.rb +4 -3
- data/app/controllers/admin/resource_controller.rb +62 -8
- data/app/controllers/admin/snippets_controller.rb +1 -0
- data/app/controllers/admin/users_controller.rb +1 -0
- data/app/controllers/application_controller.rb +0 -17
- data/app/controllers/site_controller.rb +6 -4
- data/app/helpers/application_helper.rb +19 -0
- data/app/models/standard_tags.rb +212 -18
- data/app/models/status.rb +1 -1
- data/app/models/user.rb +2 -2
- data/app/views/admin/extensions/index.html.haml +1 -1
- data/app/views/admin/layouts/_form.html.haml +4 -4
- data/app/views/admin/layouts/index.html.haml +2 -2
- data/app/views/admin/page_parts/_page_part.html.haml +2 -2
- data/app/views/admin/pages/_fields.html.haml +5 -5
- data/app/views/admin/preferences/edit.html.haml +3 -3
- data/app/views/admin/snippets/_form.html.haml +5 -5
- data/app/views/admin/snippets/index.html.haml +3 -3
- data/app/views/admin/users/_form.html.haml +3 -4
- data/app/views/admin/users/index.html.haml +2 -1
- data/app/views/layouts/application.html.haml +1 -1
- data/config/environment.rb +2 -2
- data/config/environments/cucumber.rb +3 -3
- data/config/locales/en.yml +10 -10
- data/config/locales/en_available_tags.yml +80 -1
- data/db/migrate/20081203140407_add_indexes.rb +10 -10
- data/db/schema.rb +1 -1
- data/features/admin/resource_pagination.feature +27 -0
- data/features/admin/user_preferences.feature +17 -0
- data/features/step_definitions/admin/pagination_steps.rb +46 -0
- data/features/step_definitions/web_steps.rb +13 -3
- data/features/support/env.rb +7 -3
- data/features/support/paths.rb +1 -1
- data/lib/generators/instance/templates/instance_environment.rb +2 -2
- data/lib/generators/language_extension/templates/lang.yml +6 -6
- data/lib/plugins/active_record_extensions/lib/active_record_extensions.rb +0 -29
- data/lib/radiant.rb +3 -3
- data/lib/radiant/admin_ui.rb +1 -1
- data/lib/radiant/extension/script.rb +20 -5
- data/lib/radiant/extension_loader.rb +1 -1
- data/lib/radiant/initializer.rb +9 -3
- data/lib/radiant/pagination/controller.rb +34 -0
- data/lib/radiant/pagination/link_renderer.rb +7 -4
- data/lib/task_support.rb +6 -1
- data/lib/tasks/cucumber.rake +1 -1
- data/lib/tasks/framework.rake +1 -2
- data/lib/tasks/release.rake +11 -3
- data/lib/tasks/rspec.rake +1 -1
- data/public/images/admin/shadow.png +0 -0
- data/public/images/admin/shadow_grey.png +0 -0
- data/public/javascripts/admin/application.js +4 -1
- data/public/javascripts/admin/cookie.js +2 -2
- data/public/javascripts/admin/validationerror.js +18 -0
- data/public/stylesheets/admin/main.css +110 -37
- data/public/stylesheets/sass/admin/main.sass +3 -2
- data/public/stylesheets/sass/admin/modules/_grid.sass +56 -0
- data/public/stylesheets/sass/admin/partials/_actions.sass +74 -34
- data/public/stylesheets/sass/admin/partials/{_depreciated.sass → _deprecated.sass} +1 -1
- data/public/stylesheets/sass/admin/partials/_popup.sass +1 -1
- data/public/stylesheets/sass/admin/partials/_validations.sass +21 -0
- data/spec/controllers/admin/paginated_controller_spec.rb +26 -0
- data/spec/controllers/admin/preferences_controller_spec.rb +14 -0
- data/spec/controllers/application_controller_spec.rb +1 -11
- data/spec/controllers/site_controller_spec.rb +9 -0
- data/spec/datasets/users_dataset.rb +1 -1
- data/spec/generators/instance_generator_spec.rb +1 -1
- data/spec/helpers/application_helper_spec.rb +38 -0
- data/spec/lib/radiant/extension/script_spec.rb +5 -1
- data/spec/lib/radiant/initializer_spec.rb +7 -0
- data/spec/lib/radiant_spec.rb +1 -1
- data/spec/lib/task_support_spec.rb +14 -0
- data/spec/matchers/render_matcher.rb +14 -1
- data/spec/models/layout_spec.rb +3 -3
- data/spec/models/page_part_spec.rb +3 -3
- data/spec/models/page_spec.rb +8 -9
- data/spec/models/snippet_spec.rb +3 -3
- data/spec/models/standard_tags_spec.rb +99 -5
- data/spec/models/user_spec.rb +11 -11
- data/vendor/extensions/archive/app/models/archive_finder.rb +5 -0
- data/vendor/extensions/french_language_pack/config/locales/fr.yml +31 -25
- data/vendor/extensions/german_language_pack/README +2 -1
- data/vendor/extensions/german_language_pack/config/locales/de.yml +47 -45
- data/vendor/extensions/german_language_pack/config/locales/de_available_tags.yml +375 -304
- data/vendor/extensions/german_language_pack/german_language_pack_extension.rb +2 -2
- data/vendor/extensions/markdown_filter/README +1 -1
- data/vendor/extensions/markdown_filter/lib/markdown_filter.rb +4 -4
- data/vendor/extensions/markdown_filter/lib/markdown_tags.rb +0 -15
- data/vendor/extensions/markdown_filter/markdown_filter_extension.rb +1 -10
- data/vendor/extensions/markdown_filter/spec/models/markdown_filter_spec.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/CONTRIBUTERS +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/ChangeLog +1332 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/README +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/Rakefile +97 -38
- data/vendor/extensions/markdown_filter/vendor/kramdown/VERSION +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/generate_data.rb +6 -4
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-jruby-1.4.0.dat +7 -7
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.6.dat +7 -7
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.8.7.dat +7 -7
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.1p243.dat +7 -7
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/historic-ruby-1.9.2dev.dat +7 -7
- data/vendor/extensions/markdown_filter/vendor/kramdown/benchmark/testing.sh +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/bin/kramdown +11 -4
- data/vendor/extensions/markdown_filter/vendor/kramdown/data/kramdown/document.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/data/kramdown/document.latex +43 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.less.css +510 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.template +26 -33
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/documentation.page +72 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/index.page +21 -49
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/installation.page +6 -6
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/links.markdown +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/news.page +3 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/quickref.page +140 -127
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/syntax.page +501 -431
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/tests.page +3 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/compatibility.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter.rb +8 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/base.rb +40 -4
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/html.rb +99 -27
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/converter/latex.rb +57 -18
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/document.rb +32 -13
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/error.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/options.rb +34 -14
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser.rb +9 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/base.rb +95 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/html.rb +387 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown.rb +74 -65
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/abbreviation.rb +65 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/attribute_list.rb +3 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/autolink.rb +8 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blank_line.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/blockquote.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codeblock.rb +3 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/codespan.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/emphasis.rb +4 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/eob.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/escaped_chars.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/extension.rb +47 -55
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/footnote.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/header.rb +3 -18
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/horizontal_rule.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html.rb +69 -149
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/html_entity.rb +4 -4
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/line_break.rb +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/link.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/list.rb +12 -9
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/math.rb +53 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/paragraph.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/smart_quotes.rb +5 -4
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/table.rb +4 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/parser/kramdown/typographic_symbol.rb +7 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/lib/kramdown/version.rb +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/man/man1/kramdown.1 +222 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/run_tests.rb +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/test_files.rb +68 -7
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.options +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/04_header/with_auto_id_prefix.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/item_ial.html +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/item_ial.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/mixed.html +9 -3
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.html +49 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/08_list/special_cases.text +29 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/comment.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/content_model/tables.html +2 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/code.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/code.text +9 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/comment.html +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/comment.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/emphasis.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/emphasis.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/entity.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/entity.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.options +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/header.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/options +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_normal.html +13 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_simple.html +10 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/table_simple.text +14 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/typography.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/html_to_native/typography.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.html +3 -5
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/09_html/parse_as_raw.text +0 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.html +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/auto_id_and_ial.text +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/11_ial/simple.text +7 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/comment.text +5 -5
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.html +0 -2
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/ignored.text +3 -6
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/nomarkdown.text +4 -4
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.html +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options.text +5 -6
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options2.text +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/12_extension/options3.text +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/15_math/normal.html +19 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/block/15_math/normal.text +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/errors.html +1 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.html +4 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/02_emphasis/nesting.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/definitions.latex +18 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/footnote_nr.latex +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/04_footnote/markers.latex +32 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/invalid.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/05_html/invalid.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev.html +8 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev.text +15 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev_defs.html +2 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/abbreviations/abbrev_defs.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/autolinks/url_links.text +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/comment.html +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/comment.text +6 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/ignored.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/ignored.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/nomarkdown.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/nomarkdown.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/options.html +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/extension/options.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.html +2 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/ial/simple.text +1 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/math/normal.html +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/math/normal.text +5 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.html +3 -0
- data/vendor/extensions/markdown_filter/vendor/kramdown/test/testcases/span/text_substitutions/typography.text +3 -0
- data/vendor/extensions/smarty_pants_filter/README +1 -0
- data/vendor/extensions/smarty_pants_filter/Rakefile +136 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/lib/smarty_pants_filter.rb +0 -0
- data/vendor/extensions/smarty_pants_filter/lib/smarty_pants_tags.rb +18 -0
- data/vendor/extensions/smarty_pants_filter/lib/tasks/smarty_pants_filter_extension_tasks.rake +28 -0
- data/vendor/extensions/smarty_pants_filter/smarty_pants_filter_extension.rb +18 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/smartypants.html +0 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/spec/models/smarty_pants_filter_spec.rb +0 -0
- data/vendor/extensions/smarty_pants_filter/spec/spec.opts +6 -0
- data/vendor/extensions/smarty_pants_filter/spec/spec_helper.rb +36 -0
- data/vendor/extensions/smarty_pants_filter/test/test_helper.rb +19 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/test/unit/smarty_pants_filter_test.rb +0 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/README +0 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/Rakefile +0 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/install.rb +0 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/rubypants.rb +0 -0
- data/vendor/extensions/{markdown_filter → smarty_pants_filter}/vendor/rubypants/test_rubypants.rb +0 -0
- data/vendor/plugins/haml/Rakefile +84 -52
- data/vendor/plugins/haml/VERSION +1 -1
- data/vendor/plugins/haml/doc-src/HAML_CHANGELOG.md +77 -0
- data/vendor/plugins/haml/doc-src/SASS_CHANGELOG.md +60 -0
- data/vendor/plugins/haml/extra/haml-mode.el +15 -12
- data/vendor/plugins/haml/extra/sass-mode.el +2 -2
- data/vendor/plugins/haml/haml.gemspec +16 -7
- data/vendor/plugins/haml/init.rb +3 -1
- data/vendor/plugins/haml/lib/haml.rb +1 -0
- data/vendor/plugins/haml/lib/haml/filters.rb +14 -2
- data/vendor/plugins/haml/lib/haml/helpers.rb +34 -14
- data/vendor/plugins/haml/lib/haml/helpers/action_view_extensions.rb +6 -4
- data/vendor/plugins/haml/lib/haml/helpers/action_view_mods.rb +74 -34
- data/vendor/plugins/haml/lib/haml/helpers/xss_mods.rb +37 -8
- data/vendor/plugins/haml/lib/haml/html.rb +1 -1
- data/vendor/plugins/haml/lib/haml/precompiler.rb +3 -2
- data/vendor/plugins/haml/lib/haml/railtie.rb +18 -0
- data/vendor/plugins/haml/lib/haml/template.rb +15 -4
- data/vendor/plugins/haml/lib/haml/template/plugin.rb +37 -2
- data/vendor/plugins/haml/lib/haml/util.rb +56 -2
- data/vendor/plugins/haml/lib/haml/version.rb +29 -14
- data/vendor/plugins/haml/lib/sass/files.rb +10 -2
- data/vendor/plugins/haml/lib/sass/plugin.rb +7 -2
- data/vendor/plugins/haml/lib/sass/plugin/rack.rb +2 -2
- data/vendor/plugins/haml/lib/sass/plugin/rails.rb +2 -1
- data/vendor/plugins/haml/lib/sass/script/number.rb +2 -2
- data/vendor/plugins/haml/lib/sass/tree/if_node.rb +1 -0
- data/vendor/plugins/haml/lib/sass/tree/rule_node.rb +9 -1
- data/vendor/plugins/haml/test/haml/engine_test.rb +24 -2
- data/vendor/plugins/haml/test/haml/helper_test.rb +60 -9
- data/vendor/plugins/haml/test/haml/template_test.rb +80 -3
- data/vendor/plugins/haml/test/haml/templates/helpers.haml +26 -0
- data/vendor/plugins/haml/test/haml/templates/partial_layout.haml +6 -2
- data/vendor/plugins/haml/test/sass/engine_test.rb +6 -1
- data/vendor/plugins/haml/test/test_helper.rb +16 -1
- data/vendor/radius/LICENSE +19 -0
- data/vendor/radius/QUICKSTART.rdoc +7 -7
- data/vendor/radius/README.rdoc +9 -25
- data/vendor/radius/Rakefile +4 -27
- data/vendor/radius/VERSION +1 -0
- data/vendor/radius/lib/radius/parser.rb +4 -4
- data/vendor/radius/lib/radius/parser/scan.rb +371 -940
- data/vendor/radius/lib/radius/parser/scan.rl +2 -1
- data/vendor/radius/lib/radius/version.rb +5 -11
- data/vendor/radius/radius.gemspec +55 -22
- data/vendor/radius/tasks/jeweler.rake +21 -0
- data/vendor/radius/tasks/rdoc.rake +13 -0
- data/vendor/radius/tasks/test.rake +7 -0
- data/vendor/radius/test/parser_test.rb +5 -0
- data/vendor/radius/test/test_helper.rb +1 -0
- data/vendor/rails/actionmailer/CHANGELOG +18 -0
- data/vendor/rails/actionmailer/MIT-LICENSE +1 -1
- data/vendor/rails/actionmailer/Rakefile +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/base.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/quoting.rb +1 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail.rb +1 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/Makefile +18 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/address.rb +4 -38
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/attachments.rb +65 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/base64.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/compat.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/config.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/core_extensions.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/encode.rb +9 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/header.rb +4 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/index.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/interface.rb +33 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/loader.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/mail.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/mailbox.rb +3 -2
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/main.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/mbox.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/net.rb +3 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/obsolete.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/parser.rb +1060 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/parser.y +416 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/port.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/quoting.rb +47 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/require_arch.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/scanner.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/scanner_r.rb +2 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/stringio.rb +0 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/utils.rb +50 -25
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/COPYING +504 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/README +12 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet.rb +67 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/big5freq.rb +927 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/big5prober.rb +42 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb +238 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/charsetgroupprober.rb +112 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/charsetprober.rb +75 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/codingstatemachine.rb +64 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/constants.rb +42 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb +89 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/escsm.rb +244 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/eucjpprober.rb +88 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euckrfreq.rb +596 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euckrprober.rb +42 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euctwfreq.rb +430 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/euctwprober.rb +42 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312freq.rb +474 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312prober.rb +42 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/hebrewprober.rb +289 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/jisfreq.rb +570 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/jpcntx.rb +229 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langbulgarianmodel.rb +229 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langcyrillicmodel.rb +330 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langgreekmodel.rb +227 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langhebrewmodel.rb +202 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langhungarianmodel.rb +226 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/langthaimodel.rb +201 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/latin1prober.rb +147 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/mbcharsetprober.rb +89 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/mbcsgroupprober.rb +45 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/mbcssm.rb +542 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/sbcharsetprober.rb +124 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/sbcsgroupprober.rb +56 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/sjisprober.rb +88 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/universaldetector.rb +168 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/vendor/rchardet-1.3/lib/rchardet/utf8prober.rb +87 -0
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/{tmail-1.2.3 → tmail-1.2.7}/tmail/version.rb +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail.rb +2 -2
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionmailer/test/abstract_unit.rb +4 -4
- data/vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb +1 -1
- data/vendor/rails/actionmailer/test/mail_service_test.rb +66 -2
- data/vendor/rails/actionmailer/test/quoting_test.rb +10 -4
- data/vendor/rails/actionpack/CHANGELOG +55 -0
- data/vendor/rails/actionpack/MIT-LICENSE +1 -1
- data/vendor/rails/actionpack/README +7 -7
- data/vendor/rails/actionpack/Rakefile +2 -2
- data/vendor/rails/actionpack/lib/action_controller.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +18 -9
- data/vendor/rails/actionpack/lib/action_controller/base.rb +14 -14
- data/vendor/rails/actionpack/lib/action_controller/caching/fragments.rb +6 -6
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +96 -0
- data/vendor/rails/actionpack/lib/action_controller/failsafe.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/flash.rb +42 -0
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +5 -1
- data/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/rack_lint_patch.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/rescue.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/response.rb +4 -7
- data/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb +6 -0
- data/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb +6 -0
- data/vendor/rails/actionpack/lib/action_controller/templates/rescues/_trace.erb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +4 -1
- data/vendor/rails/actionpack/lib/action_pack.rb +1 -1
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view.rb +3 -3
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +11 -11
- data/vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb +12 -11
- data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb +49 -12
- data/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +3 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb +7 -4
- data/vendor/rails/actionpack/lib/action_view/helpers/javascript_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/raw_output_helper.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb +2 -10
- data/vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb +6 -5
- data/vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb +5 -5
- data/vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb +37 -9
- data/vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb +9 -11
- data/vendor/rails/actionpack/lib/action_view/partials.rb +2 -1
- data/vendor/rails/actionpack/lib/action_view/paths.rb +8 -0
- data/vendor/rails/actionpack/lib/action_view/renderable.rb +16 -2
- data/vendor/rails/actionpack/lib/action_view/template_handlers/erb.rb +7 -4
- data/vendor/rails/actionpack/lib/action_view/test_case.rb +1 -1
- data/vendor/rails/actionpack/test/abstract_unit.rb +8 -8
- data/vendor/rails/actionpack/test/active_record_unit.rb +1 -1
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +3 -1
- data/vendor/rails/actionpack/test/controller/assert_select_test.rb +6 -5
- data/vendor/rails/actionpack/test/controller/caching_test.rb +16 -2
- data/vendor/rails/actionpack/test/controller/capture_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +37 -1
- data/vendor/rails/actionpack/test/controller/flash_test.rb +28 -1
- data/vendor/rails/actionpack/test/controller/helper_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/integration_test.rb +0 -1
- data/vendor/rails/actionpack/test/controller/localized_templates_test.rb +24 -0
- data/vendor/rails/actionpack/test/controller/output_escaping_test.rb +19 -0
- data/vendor/rails/actionpack/test/controller/rack_test.rb +1 -4
- data/vendor/rails/actionpack/test/controller/render_test.rb +11 -2
- data/vendor/rails/actionpack/test/controller/rescue_test.rb +8 -2
- data/vendor/rails/actionpack/test/controller/routing_test.rb +1 -0
- data/vendor/rails/actionpack/test/controller/send_file_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/session/cookie_store_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +10 -6
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.de.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/localized/hello_world.en.html +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_customer_counter_with_as.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_utf8_partial.html.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/_utf8_partial_magic.html.erb +2 -0
- data/vendor/rails/actionpack/test/fixtures/test/array_translation.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/capturing.erb +2 -2
- data/vendor/rails/actionpack/test/fixtures/test/scoped_array_translation.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/translation.erb +1 -0
- data/vendor/rails/actionpack/test/fixtures/test/utf8.html.erb +4 -2
- data/vendor/rails/actionpack/test/fixtures/test/utf8_magic.html.erb +5 -0
- data/vendor/rails/actionpack/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +5 -0
- data/vendor/rails/actionpack/test/template/active_record_helper_i18n_test.rb +9 -2
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +0 -1
- data/vendor/rails/actionpack/test/template/date_helper_test.rb +118 -0
- data/vendor/rails/actionpack/test/template/erb_util_test.rb +12 -0
- data/vendor/rails/actionpack/test/template/form_helper_test.rb +57 -3
- data/vendor/rails/actionpack/test/template/form_tag_helper_test.rb +21 -9
- data/vendor/rails/actionpack/test/template/render_test.rb +47 -8
- data/vendor/rails/actionpack/test/template/text_helper_test.rb +26 -1
- data/vendor/rails/actionpack/test/template/translation_helper_test.rb +72 -9
- data/vendor/rails/actionpack/test/template/url_helper_test.rb +20 -1
- data/vendor/rails/actionpack/test/view/test_case_test.rb +2 -2
- data/vendor/rails/activerecord/CHANGELOG +43 -0
- data/vendor/rails/activerecord/Rakefile +1 -1
- data/vendor/rails/activerecord/examples/performance.sql +85 -0
- data/vendor/rails/activerecord/lib/active_record.rb +1 -2
- data/vendor/rails/activerecord/lib/active_record/association_preload.rb +9 -2
- data/vendor/rails/activerecord/lib/active_record/associations.rb +48 -38
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +15 -11
- data/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb +16 -6
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb +11 -1
- data/vendor/rails/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb +34 -10
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +5 -0
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +5 -5
- data/vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb +10 -1
- data/vendor/rails/activerecord/lib/active_record/attribute_methods.rb +5 -1
- data/vendor/rails/activerecord/lib/active_record/autosave_association.rb +66 -35
- data/vendor/rails/activerecord/lib/active_record/base.rb +77 -36
- data/vendor/rails/activerecord/lib/active_record/batches.rb +13 -9
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +6 -3
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +3 -3
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_limits.rb +57 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +3 -7
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +64 -10
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +2 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +31 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +31 -66
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +5 -5
- data/vendor/rails/activerecord/lib/active_record/dirty.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +1 -0
- data/vendor/rails/activerecord/lib/active_record/locking/optimistic.rb +34 -1
- data/vendor/rails/activerecord/lib/active_record/migration.rb +5 -0
- data/vendor/rails/activerecord/lib/active_record/nested_attributes.rb +64 -52
- data/vendor/rails/activerecord/lib/active_record/reflection.rb +66 -1
- data/vendor/rails/activerecord/lib/active_record/schema.rb +5 -1
- data/vendor/rails/activerecord/lib/active_record/schema_dumper.rb +3 -0
- data/vendor/rails/activerecord/lib/active_record/serializers/json_serializer.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/validations.rb +13 -1
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/test/cases/active_schema_test_mysql.rb +22 -0
- data/vendor/rails/activerecord/test/cases/associations/belongs_to_associations_test.rb +13 -0
- data/vendor/rails/activerecord/test/cases/associations/eager_load_nested_include_test.rb +8 -7
- data/vendor/rails/activerecord/test/cases/associations/eager_test.rb +7 -1
- data/vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb +26 -0
- data/vendor/rails/activerecord/test/cases/associations/inverse_associations_test.rb +566 -0
- data/vendor/rails/activerecord/test/cases/associations_test.rb +10 -0
- data/vendor/rails/activerecord/test/cases/autosave_association_test.rb +86 -10
- data/vendor/rails/activerecord/test/cases/base_test.rb +29 -0
- data/vendor/rails/activerecord/test/cases/batches_test.rb +20 -0
- data/vendor/rails/activerecord/test/cases/calculations_test.rb +2 -3
- data/vendor/rails/activerecord/test/cases/encoding_test.rb +6 -0
- data/vendor/rails/activerecord/test/cases/finder_test.rb +19 -3
- data/vendor/rails/activerecord/test/cases/fixtures_test.rb +5 -0
- data/vendor/rails/activerecord/test/cases/json_serialization_test.rb +14 -0
- data/vendor/rails/activerecord/test/cases/locking_test.rb +48 -3
- data/vendor/rails/activerecord/test/cases/migration_test.rb +115 -0
- data/vendor/rails/activerecord/test/cases/modules_test.rb +28 -0
- data/vendor/rails/activerecord/test/cases/named_scope_test.rb +1 -1
- data/vendor/rails/activerecord/test/cases/nested_attributes_test.rb +239 -7
- data/vendor/rails/activerecord/test/cases/query_cache_test.rb +7 -1
- data/vendor/rails/activerecord/test/cases/reflection_test.rb +47 -7
- data/vendor/rails/activerecord/test/cases/schema_test_postgresql.rb +2 -2
- data/vendor/rails/activerecord/test/cases/validations_i18n_test.rb +6 -36
- data/vendor/rails/activerecord/test/cases/validations_test.rb +33 -1
- data/vendor/rails/activerecord/test/cases/yaml_serialization_test.rb +11 -0
- data/vendor/rails/activerecord/test/fixtures/faces.yml +11 -0
- data/vendor/rails/{pkg/rails-3.0.pre.gem → activerecord/test/fixtures/fixture_database.sqlite} +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite +0 -0
- data/vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite3 +0 -0
- data/vendor/rails/activerecord/test/fixtures/interests.yml +33 -0
- data/vendor/rails/activerecord/test/fixtures/men.yml +5 -0
- data/vendor/rails/activerecord/test/fixtures/zines.yml +5 -0
- data/vendor/rails/activerecord/test/models/author.rb +3 -0
- data/vendor/rails/activerecord/test/models/bird.rb +6 -0
- data/vendor/rails/activerecord/test/models/company_in_module.rb +17 -0
- data/vendor/rails/activerecord/test/models/event_author.rb +5 -0
- data/vendor/rails/activerecord/test/models/face.rb +7 -0
- data/vendor/rails/activerecord/test/models/interest.rb +5 -0
- data/vendor/rails/activerecord/test/models/invoice.rb +4 -0
- data/vendor/rails/activerecord/test/models/line_item.rb +3 -0
- data/vendor/rails/activerecord/test/models/man.rb +9 -0
- data/vendor/rails/activerecord/test/models/parrot.rb +6 -0
- data/vendor/rails/activerecord/test/models/pirate.rb +10 -0
- data/vendor/rails/activerecord/test/models/ship.rb +10 -1
- data/vendor/rails/activerecord/test/models/ship_part.rb +3 -1
- data/vendor/rails/activerecord/test/models/zine.rb +3 -0
- data/vendor/rails/activerecord/test/schema/schema.rb +41 -0
- data/vendor/rails/activeresource/CHANGELOG +15 -0
- data/vendor/rails/activeresource/Rakefile +1 -1
- data/vendor/rails/activeresource/lib/active_resource/base.rb +11 -2
- data/vendor/rails/activeresource/lib/active_resource/http_mock.rb +2 -2
- data/vendor/rails/activeresource/lib/active_resource/validations.rb +3 -3
- data/vendor/rails/activeresource/lib/active_resource/version.rb +1 -1
- data/vendor/rails/activeresource/test/abstract_unit.rb +2 -2
- data/vendor/rails/activeresource/test/base_errors_test.rb +13 -0
- data/vendor/rails/activeresource/test/base_test.rb +49 -0
- data/vendor/rails/activeresource/test/debug.log +80350 -0
- data/vendor/rails/activesupport/CHANGELOG +37 -0
- data/vendor/rails/activesupport/lib/active_support.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/buffered_logger.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/cache/memory_store.rb +7 -1
- data/vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/array/random_access.rb +11 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/class/attribute_accessors.rb +35 -28
- data/vendor/rails/activesupport/lib/active_support/core_ext/date/calculations.rb +14 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/date_time/conversions.rb +14 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/enumerable.rb +6 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/file/atomic.rb +2 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attr_accessor_with_default.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb +33 -26
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/synchronization.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/numeric/conversions.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/object.rb +1 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/blank.rb +20 -2
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/metaclass.rb +6 -5
- data/vendor/rails/activesupport/lib/active_support/core_ext/object/singleton_class.rb +13 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/string.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb +108 -44
- data/vendor/rails/activesupport/lib/active_support/core_ext/string/starts_ends_with.rb +2 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/time.rb +8 -4
- data/vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb +12 -3
- data/vendor/rails/activesupport/lib/active_support/deprecation.rb +3 -2
- data/vendor/rails/activesupport/lib/active_support/inflections.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/inflector.rb +5 -2
- data/vendor/rails/activesupport/lib/active_support/json/backends/yajl.rb +40 -0
- data/vendor/rails/activesupport/lib/active_support/json/backends/yaml.rb +10 -7
- data/vendor/rails/activesupport/lib/active_support/json/decoding.rb +16 -1
- data/vendor/rails/activesupport/lib/active_support/json/encoding.rb +11 -2
- data/vendor/rails/activesupport/lib/active_support/memoizable.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/multibyte/unicode_database.rb +2 -2
- data/vendor/rails/activesupport/lib/active_support/multibyte/utils.rb +6 -7
- data/vendor/rails/activesupport/lib/active_support/ordered_hash.rb +28 -11
- data/vendor/rails/activesupport/lib/active_support/testing/assertions.rb +14 -0
- data/vendor/rails/activesupport/lib/active_support/values/time_zone.rb +84 -76
- data/vendor/rails/activesupport/lib/active_support/vendor.rb +10 -2
- data/vendor/rails/activesupport/lib/active_support/vendor/{i18n-0.1.3/lib → i18n-0.3.7}/i18n.rb +175 -39
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend.rb +19 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record.rb +66 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/missing.rb +67 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/store_procs.rb +38 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/active_record/translation.rb +88 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/base.rb +266 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cache.rb +76 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cascade.rb +58 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/chain.rb +75 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/cldr.rb +100 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fallbacks.rb +69 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/fast.rb +69 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/gettext.rb +75 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/helpers.rb +68 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/interpolation_compiler.rb +119 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/links.rb +34 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/metadata.rb +73 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/pluralization.rb +57 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/backend/simple.rb +22 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/except.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/hash/slice.rb +8 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/object/meta_class.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/core_ext/string/interpolate.rb +99 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/{i18n-0.1.3/lib → i18n-0.3.7}/i18n/exceptions.rb +15 -7
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/gettext.rb +25 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/gettext/po_parser.rb +329 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/helpers.rb +5 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/helpers/gettext.rb +65 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale.rb +6 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/fallbacks.rb +98 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag.rb +28 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/parents.rb +24 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/rfc4646.rb +76 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/locale/tag/simple.rb +41 -0
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.3.7/i18n/version.rb +3 -0
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/whiny_nil.rb +1 -1
- data/vendor/rails/activesupport/lib/active_support/xml_mini/libxml.rb +23 -83
- data/vendor/rails/activesupport/lib/active_support/xml_mini/libxmlsax.rb +74 -0
- data/vendor/rails/activesupport/lib/active_support/xml_mini/nokogiri.rb +25 -22
- data/vendor/rails/activesupport/lib/active_support/xml_mini/nokogirisax.rb +73 -0
- data/vendor/rails/railties/CHANGELOG +18 -2
- data/vendor/rails/railties/MIT-LICENSE +1 -1
- data/vendor/rails/railties/Rakefile +5 -5
- data/vendor/rails/railties/bin/rails +6 -5
- data/vendor/rails/railties/builtin/rails_info/rails/info.rb +1 -1
- data/vendor/rails/railties/configs/initializers/cookie_verification_secret.rb +7 -0
- data/vendor/rails/railties/guides/source/getting_started.textile +2 -2
- data/vendor/rails/railties/lib/commands/dbconsole.rb +1 -1
- data/vendor/rails/railties/lib/commands/runner.rb +1 -1
- data/vendor/rails/railties/lib/dispatcher.rb +1 -1
- data/vendor/rails/railties/lib/rails/gem_dependency.rb +11 -4
- data/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb +1 -1
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator.rb +5 -2
- data/vendor/rails/railties/lib/rails_generator/generated_attribute.rb +7 -6
- data/vendor/rails/railties/lib/rails_generator/generators/applications/app/app_generator.rb +3 -0
- data/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/fixtures.yml +9 -5
- data/vendor/rails/railties/lib/rails_generator/generators/components/plugin/plugin_generator.rb +2 -2
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/controller.rb +2 -4
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +1 -1
- data/vendor/rails/railties/lib/tasks/databases.rake +14 -14
- data/vendor/rails/railties/lib/tasks/framework.rake +4 -1
- data/vendor/rails/railties/lib/tasks/rails.rb +6 -1
- metadata +276 -321
- data/config/initializers/pagination.rb +0 -1
- data/vendor/extensions/markdown_filter/vendor/kramdown/doc/default.css +0 -293
- data/vendor/plugins/haml/FAQ +0 -138
- data/vendor/plugins/haml/README.rdoc +0 -319
- data/vendor/plugins/haml/REVISION +0 -1
- data/vendor/plugins/haml/lib/sass/constant.rb +0 -216
- data/vendor/plugins/haml/lib/sass/constant/color.rb +0 -101
- data/vendor/plugins/haml/lib/sass/constant/literal.rb +0 -54
- data/vendor/plugins/haml/lib/sass/constant/nil.rb +0 -9
- data/vendor/plugins/haml/lib/sass/constant/number.rb +0 -87
- data/vendor/plugins/haml/lib/sass/constant/operation.rb +0 -30
- data/vendor/plugins/haml/lib/sass/constant/string.rb +0 -22
- data/vendor/plugins/haml/lib/sass/tree/attr_node.rb +0 -57
- data/vendor/plugins/haml/lib/sass/tree/value_node.rb +0 -20
- data/vendor/plugins/haml/test/sass/results/constants.css +0 -16
- data/vendor/plugins/haml/test/sass/templates/constants.sass +0 -100
- data/vendor/radius/Manifest.txt +0 -21
- data/vendor/rails/Rakefile +0 -81
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/attachments.rb +0 -46
- data/vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb +0 -1478
- data/vendor/rails/actionmailer/pkg/actionmailer-3.0.pre.gem +0 -0
- data/vendor/rails/actionpack/lib/action_view/erb/util.rb +0 -44
- data/vendor/rails/actionpack/lib/action_view/safe_buffer.rb +0 -28
- data/vendor/rails/actionpack/pkg/actionpack-3.0.pre.gem +0 -0
- data/vendor/rails/actionpack/test/view/safe_buffer_test.rb +0 -36
- data/vendor/rails/activemodel/CHANGES +0 -12
- data/vendor/rails/activemodel/README +0 -21
- data/vendor/rails/activemodel/Rakefile +0 -24
- data/vendor/rails/activemodel/lib/active_model.rb +0 -5
- data/vendor/rails/activemodel/lib/active_model/base.rb +0 -8
- data/vendor/rails/activemodel/lib/active_model/callbacks.rb +0 -7
- data/vendor/rails/activemodel/lib/active_model/core.rb +0 -7
- data/vendor/rails/activemodel/lib/active_model/deprecated_error_methods.rb +0 -38
- data/vendor/rails/activemodel/lib/active_model/errors.rb +0 -82
- data/vendor/rails/activemodel/lib/active_model/observing.rb +0 -98
- data/vendor/rails/activemodel/lib/active_model/state_machine.rb +0 -68
- data/vendor/rails/activemodel/lib/active_model/state_machine/event.rb +0 -64
- data/vendor/rails/activemodel/lib/active_model/state_machine/machine.rb +0 -78
- data/vendor/rails/activemodel/lib/active_model/state_machine/state.rb +0 -47
- data/vendor/rails/activemodel/lib/active_model/state_machine/state_transition.rb +0 -40
- data/vendor/rails/activemodel/lib/active_model/validations.rb +0 -126
- data/vendor/rails/activemodel/lib/active_model/validations/acceptance.rb +0 -45
- data/vendor/rails/activemodel/lib/active_model/validations/associated.rb +0 -46
- data/vendor/rails/activemodel/lib/active_model/validations/confirmation.rb +0 -44
- data/vendor/rails/activemodel/lib/active_model/validations/exclusion.rb +0 -37
- data/vendor/rails/activemodel/lib/active_model/validations/format.rb +0 -39
- data/vendor/rails/activemodel/lib/active_model/validations/inclusion.rb +0 -37
- data/vendor/rails/activemodel/lib/active_model/validations/length.rb +0 -95
- data/vendor/rails/activemodel/lib/active_model/validations/numericality.rb +0 -80
- data/vendor/rails/activemodel/lib/active_model/validations/presence.rb +0 -42
- data/vendor/rails/activemodel/lib/active_model/validations/uniqueness.rb +0 -104
- data/vendor/rails/activemodel/pkg/activemodel-3.0.pre.gem +0 -0
- data/vendor/rails/activemodel/test/observing_test.rb +0 -121
- data/vendor/rails/activemodel/test/state_machine/event_test.rb +0 -49
- data/vendor/rails/activemodel/test/state_machine/machine_test.rb +0 -43
- data/vendor/rails/activemodel/test/state_machine/state_test.rb +0 -72
- data/vendor/rails/activemodel/test/state_machine/state_transition_test.rb +0 -84
- data/vendor/rails/activemodel/test/state_machine_test.rb +0 -312
- data/vendor/rails/activemodel/test/test_helper.rb +0 -21
- data/vendor/rails/activerecord/MIT-LICENSE +0 -20
- data/vendor/rails/activerecord/lib/active_record/i18n_interpolation_deprecation.rb +0 -26
- data/vendor/rails/activerecord/pkg/activerecord-3.0.pre.gem +0 -0
- data/vendor/rails/activeresource/MIT-LICENSE +0 -20
- data/vendor/rails/activeresource/pkg/activeresource-3.0.pre.gem +0 -0
- data/vendor/rails/activesupport/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/Rakefile +0 -175
- data/vendor/rails/activesupport/bin/generate_tables +0 -147
- data/vendor/rails/activesupport/install.rb +0 -30
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/MIT-LICENSE +0 -20
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/README.textile +0 -20
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/Rakefile +0 -5
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/i18n.gemspec +0 -27
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb +0 -214
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/all.rb +0 -5
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb +0 -99
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb +0 -124
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.rb +0 -1
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/locale/en.yml +0 -3
- data/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb +0 -567
- data/vendor/rails/activesupport/pkg/activesupport-3.0.pre.gem +0 -0
- data/vendor/rails/activesupport/test/abstract_unit.rb +0 -36
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/b.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/d.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/a/c/e/f.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/application.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/class_folder_subclass.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/class_folder/nested_class.rb +0 -7
- data/vendor/rails/activesupport/test/autoloading_fixtures/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/counting_loader.rb +0 -5
- data/vendor/rails/activesupport/test/autoloading_fixtures/cross_site_dependency.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/e.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/inline_class.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_class.rb +0 -4
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_folder/nested_sibling.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/module_with_custom_const_missing/a/b.rb +0 -1
- data/vendor/rails/activesupport/test/autoloading_fixtures/multiple_constant_file.rb +0 -2
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_name_error.rb +0 -3
- data/vendor/rails/activesupport/test/autoloading_fixtures/raises_no_method_error.rb +0 -3
- data/vendor/rails/activesupport/test/buffered_logger_test.rb +0 -146
- data/vendor/rails/activesupport/test/caching_test.rb +0 -348
- data/vendor/rails/activesupport/test/callbacks_test.rb +0 -188
- data/vendor/rails/activesupport/test/clean_backtrace_test.rb +0 -47
- data/vendor/rails/activesupport/test/clean_logger_test.rb +0 -57
- data/vendor/rails/activesupport/test/core_ext/array_ext_test.rb +0 -363
- data/vendor/rails/activesupport/test/core_ext/base64_ext_test.rb +0 -8
- data/vendor/rails/activesupport/test/core_ext/bigdecimal.rb +0 -10
- data/vendor/rails/activesupport/test/core_ext/blank_test.rb +0 -24
- data/vendor/rails/activesupport/test/core_ext/cgi_ext_test.rb +0 -14
- data/vendor/rails/activesupport/test/core_ext/class/attribute_accessor_test.rb +0 -31
- data/vendor/rails/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb +0 -224
- data/vendor/rails/activesupport/test/core_ext/class/delegating_attributes_test.rb +0 -115
- data/vendor/rails/activesupport/test/core_ext/class_test.rb +0 -46
- data/vendor/rails/activesupport/test/core_ext/date_ext_test.rb +0 -278
- data/vendor/rails/activesupport/test/core_ext/date_time_ext_test.rb +0 -359
- data/vendor/rails/activesupport/test/core_ext/duplicable_test.rb +0 -22
- data/vendor/rails/activesupport/test/core_ext/duration_test.rb +0 -121
- data/vendor/rails/activesupport/test/core_ext/enumerable_test.rb +0 -97
- data/vendor/rails/activesupport/test/core_ext/exception_test.rb +0 -68
- data/vendor/rails/activesupport/test/core_ext/file_test.rb +0 -67
- data/vendor/rails/activesupport/test/core_ext/float_ext_test.rb +0 -25
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +0 -1014
- data/vendor/rails/activesupport/test/core_ext/integer_ext_test.rb +0 -37
- data/vendor/rails/activesupport/test/core_ext/kernel_test.rb +0 -43
- data/vendor/rails/activesupport/test/core_ext/load_error_test.rb +0 -16
- data/vendor/rails/activesupport/test/core_ext/module/attr_accessor_with_default_test.rb +0 -30
- data/vendor/rails/activesupport/test/core_ext/module/attr_internal_test.rb +0 -52
- data/vendor/rails/activesupport/test/core_ext/module/attribute_accessor_test.rb +0 -33
- data/vendor/rails/activesupport/test/core_ext/module/attribute_aliasing_test.rb +0 -58
- data/vendor/rails/activesupport/test/core_ext/module/model_naming_test.rb +0 -27
- data/vendor/rails/activesupport/test/core_ext/module/synchronization_test.rb +0 -85
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +0 -363
- data/vendor/rails/activesupport/test/core_ext/name_error_test.rb +0 -20
- data/vendor/rails/activesupport/test/core_ext/numeric_ext_test.rb +0 -162
- data/vendor/rails/activesupport/test/core_ext/object_and_class_ext_test.rb +0 -282
- data/vendor/rails/activesupport/test/core_ext/object_ext_test.rb +0 -8
- data/vendor/rails/activesupport/test/core_ext/pathname_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/proc_test.rb +0 -11
- data/vendor/rails/activesupport/test/core_ext/range_ext_test.rb +0 -63
- data/vendor/rails/activesupport/test/core_ext/string_ext_test.rb +0 -369
- data/vendor/rails/activesupport/test/core_ext/symbol_test.rb +0 -9
- data/vendor/rails/activesupport/test/core_ext/time_ext_test.rb +0 -744
- data/vendor/rails/activesupport/test/core_ext/time_with_zone_test.rb +0 -845
- data/vendor/rails/activesupport/test/core_ext/uri_ext_test.rb +0 -12
- data/vendor/rails/activesupport/test/dependencies/check_warnings.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies/conflict.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/cross_site_depender.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/mutual_one.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/mutual_two.rb +0 -4
- data/vendor/rails/activesupport/test/dependencies/raises_exception.rb +0 -3
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent0.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/requires_nonexistent1.rb +0 -1
- data/vendor/rails/activesupport/test/dependencies/service_one.rb +0 -5
- data/vendor/rails/activesupport/test/dependencies/service_two.rb +0 -2
- data/vendor/rails/activesupport/test/dependencies_test.rb +0 -782
- data/vendor/rails/activesupport/test/deprecation_test.rb +0 -167
- data/vendor/rails/activesupport/test/flush_cache_on_private_memoization_test.rb +0 -43
- data/vendor/rails/activesupport/test/gzip_test.rb +0 -7
- data/vendor/rails/activesupport/test/i18n_test.rb +0 -98
- data/vendor/rails/activesupport/test/inflector_test.rb +0 -298
- data/vendor/rails/activesupport/test/inflector_test_cases.rb +0 -252
- data/vendor/rails/activesupport/test/json/decoding_test.rb +0 -73
- data/vendor/rails/activesupport/test/json/encoding_test.rb +0 -160
- data/vendor/rails/activesupport/test/memoizable_test.rb +0 -247
- data/vendor/rails/activesupport/test/message_encryptor_test.rb +0 -46
- data/vendor/rails/activesupport/test/message_verifier_test.rb +0 -31
- data/vendor/rails/activesupport/test/multibyte_chars_test.rb +0 -606
- data/vendor/rails/activesupport/test/multibyte_conformance.rb +0 -129
- data/vendor/rails/activesupport/test/multibyte_test_helpers.rb +0 -19
- data/vendor/rails/activesupport/test/multibyte_unicode_database_test.rb +0 -22
- data/vendor/rails/activesupport/test/multibyte_utils_test.rb +0 -137
- data/vendor/rails/activesupport/test/option_merger_test.rb +0 -85
- data/vendor/rails/activesupport/test/ordered_hash_test.rb +0 -201
- data/vendor/rails/activesupport/test/ordered_options_test.rb +0 -53
- data/vendor/rails/activesupport/test/rescuable_test.rb +0 -75
- data/vendor/rails/activesupport/test/secure_random_test.rb +0 -19
- data/vendor/rails/activesupport/test/string_inquirer_test.rb +0 -15
- data/vendor/rails/activesupport/test/test_test.rb +0 -148
- data/vendor/rails/activesupport/test/time_zone_test.rb +0 -266
- data/vendor/rails/activesupport/test/whiny_nil_test.rb +0 -50
- data/vendor/rails/activesupport/test/xml_mini/jdom_engine_test.rb +0 -153
- data/vendor/rails/activesupport/test/xml_mini/nokogiri_engine_test.rb +0 -168
- data/vendor/rails/activesupport/test/xml_mini/rexml_engine_test.rb +0 -15
- data/vendor/rails/ci/ci_build.rb +0 -119
- data/vendor/rails/ci/ci_setup_notes.txt +0 -131
- data/vendor/rails/ci/cruise_config.rb +0 -9
- data/vendor/rails/ci/geminstaller.yml +0 -24
- data/vendor/rails/ci/site.css +0 -13
- data/vendor/rails/ci/site_config.rb +0 -72
- data/vendor/rails/doc/template/horo.rb +0 -613
- data/vendor/rails/pushgems.rb +0 -14
- data/vendor/rails/railties/pkg/railties-3.0.pre.gem +0 -0
- data/vendor/rails/railties/test/abstract_unit.rb +0 -27
- data/vendor/rails/railties/test/backtrace_cleaner_test.rb +0 -61
- data/vendor/rails/railties/test/boot_test.rb +0 -178
- data/vendor/rails/railties/test/console_app_test.rb +0 -42
- data/vendor/rails/railties/test/fcgi_dispatcher_test.rb +0 -266
- data/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml +0 -1
- data/vendor/rails/railties/test/fixtures/about_yml_plugins/bad_about_yml/init.rb +0 -1
- data/vendor/rails/railties/test/fixtures/about_yml_plugins/plugin_without_about_yml/init.rb +0 -1
- data/vendor/rails/railties/test/fixtures/eager/zoo.rb +0 -3
- data/vendor/rails/railties/test/fixtures/eager/zoo/reptile_house.rb +0 -2
- data/vendor/rails/railties/test/fixtures/environment_with_constant.rb +0 -1
- data/vendor/rails/railties/test/fixtures/lib/generators/missing_class/missing_class_generator.rb +0 -0
- data/vendor/rails/railties/test/fixtures/lib/generators/working/working_generator.rb +0 -2
- data/vendor/rails/railties/test/fixtures/metal/multiplemetals/app/metal/metal_a.rb +0 -5
- data/vendor/rails/railties/test/fixtures/metal/multiplemetals/app/metal/metal_b.rb +0 -5
- data/vendor/rails/railties/test/fixtures/metal/pluralmetal/app/metal/legacy_routes.rb +0 -5
- data/vendor/rails/railties/test/fixtures/metal/singlemetal/app/metal/foo_metal.rb +0 -5
- data/vendor/rails/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_a.rb +0 -7
- data/vendor/rails/railties/test/fixtures/metal/subfolders/app/metal/Folder/metal_b.rb +0 -7
- data/vendor/rails/railties/test/fixtures/plugins/alternate/a/generators/a_generator/a_generator.rb +0 -4
- data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/init.rb +0 -1
- data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/lib/gemlike.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/default/gemlike/rails/init.rb +0 -7
- data/vendor/rails/railties/test/fixtures/plugins/default/plugin_with_no_lib_dir/init.rb +0 -0
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/about.yml +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/generators/stubby_generator/stubby_generator.rb +0 -4
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/init.rb +0 -7
- data/vendor/rails/railties/test/fixtures/plugins/default/stubby/lib/stubby_mixin.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/controllers/engine_controller.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/metal/engine_metal.rb +0 -10
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/app/models/engine_model.rb +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/config/locales/en.yml +0 -2
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/config/routes.rb +0 -3
- data/vendor/rails/railties/test/fixtures/plugins/engines/engine/init.rb +0 -3
- data/vendor/rails/railties/test/fixtures/public/foo/bar.html +0 -1
- data/vendor/rails/railties/test/fixtures/public/foo/index.html +0 -1
- data/vendor/rails/railties/test/fixtures/public/index.html +0 -1
- data/vendor/rails/railties/test/gem_dependency_test.rb +0 -219
- data/vendor/rails/railties/test/generator_lookup_test.rb +0 -40
- data/vendor/rails/railties/test/generators/generator_test_helper.rb +0 -310
- data/vendor/rails/railties/test/generators/rails_controller_generator_test.rb +0 -44
- data/vendor/rails/railties/test/generators/rails_helper_generator_test.rb +0 -36
- data/vendor/rails/railties/test/generators/rails_mailer_generator_test.rb +0 -29
- data/vendor/rails/railties/test/generators/rails_model_generator_test.rb +0 -96
- data/vendor/rails/railties/test/generators/rails_resource_generator_test.rb +0 -29
- data/vendor/rails/railties/test/generators/rails_scaffold_generator_test.rb +0 -151
- data/vendor/rails/railties/test/generators/rails_template_runner_test.rb +0 -216
- data/vendor/rails/railties/test/initializer_test.rb +0 -416
- data/vendor/rails/railties/test/metal_test.rb +0 -72
- data/vendor/rails/railties/test/mocks/routes.rb +0 -6
- data/vendor/rails/railties/test/plugin_loader_test.rb +0 -172
- data/vendor/rails/railties/test/plugin_locator_test.rb +0 -62
- data/vendor/rails/railties/test/plugin_test.rb +0 -162
- data/vendor/rails/railties/test/plugin_test_helper.rb +0 -29
- data/vendor/rails/railties/test/rack_static_test.rb +0 -46
- data/vendor/rails/railties/test/rails_generator_test.rb +0 -145
- data/vendor/rails/railties/test/rails_info_controller_test.rb +0 -52
- data/vendor/rails/railties/test/rails_info_test.rb +0 -99
- data/vendor/rails/railties/test/secret_key_generation_test.rb +0 -38
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-a-0.4.0/lib/dummy-gem-a.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-b-0.4.0/lib/dummy-gem-b.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-b-0.6.0/lib/dummy-gem-b.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-c-0.4.0/lib/dummy-gem-c.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-c-0.6.0/lib/dummy-gem-c.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-d-1.0.0/lib/dummy-gem-d.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-e-1.0.0/lib/dummy-gem-e.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-f-1.0.0/lib/dummy-gem-f.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-g-1.0.0/lib/dummy-gem-g.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-h-1.0.0/lib/dummy-gem-h.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-i-1.0.0/ext/dummy-gem-i/Makefile +0 -0
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-i-1.0.0/lib/dummy-gem-i.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-j-1.0.0/lib/dummy-gem-j.rb +0 -1
- data/vendor/rails/railties/test/vendor/gems/dummy-gem-k-1.0.0/lib/dummy-gem-k.rb +0 -1
- data/vendor/rails/release.rb +0 -25
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
|
3
|
-
class DuplicableTest < Test::Unit::TestCase
|
4
|
-
NO = [nil, false, true, :symbol, 1, 2.3, BigDecimal.new('4.56'), Class.new]
|
5
|
-
YES = ['1', Object.new, /foo/, [], {}, Time.now]
|
6
|
-
|
7
|
-
def test_duplicable
|
8
|
-
NO.each do |v|
|
9
|
-
assert !v.duplicable?
|
10
|
-
begin
|
11
|
-
v.dup
|
12
|
-
fail
|
13
|
-
rescue Exception
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
YES.each do |v|
|
18
|
-
assert v.duplicable?
|
19
|
-
assert_nothing_raised { v.dup }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,121 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
|
3
|
-
class DurationTest < ActiveSupport::TestCase
|
4
|
-
def test_inspect
|
5
|
-
assert_equal '0 seconds', 0.seconds.inspect
|
6
|
-
assert_equal '1 month', 1.month.inspect
|
7
|
-
assert_equal '1 month and 1 day', (1.month + 1.day).inspect
|
8
|
-
assert_equal '6 months and -2 days', (6.months - 2.days).inspect
|
9
|
-
assert_equal '10 seconds', 10.seconds.inspect
|
10
|
-
assert_equal '10 years, 2 months, and 1 day', (10.years + 2.months + 1.day).inspect
|
11
|
-
assert_equal '7 days', 1.week.inspect
|
12
|
-
assert_equal '14 days', 1.fortnight.inspect
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_minus_with_duration_does_not_break_subtraction_of_date_from_date
|
16
|
-
assert_nothing_raised { Date.today - Date.today }
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_plus_with_time
|
20
|
-
assert_equal 1 + 1.second, 1.second + 1, "Duration + Numeric should == Numeric + Duration"
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_argument_error
|
24
|
-
begin
|
25
|
-
1.second.ago('')
|
26
|
-
flunk("no exception was raised")
|
27
|
-
rescue ArgumentError => e
|
28
|
-
assert_equal 'expected a time or date, got ""', e.message, "ensure ArgumentError is not being raised by dependencies.rb"
|
29
|
-
rescue Exception
|
30
|
-
flunk("ArgumentError should be raised, but we got #{$!.class} instead")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def test_fractional_weeks
|
35
|
-
assert_equal((86400 * 7) * 1.5, 1.5.weeks)
|
36
|
-
assert_equal((86400 * 7) * 1.7, 1.7.weeks)
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_fractional_days
|
40
|
-
assert_equal 86400 * 1.5, 1.5.days
|
41
|
-
assert_equal 86400 * 1.7, 1.7.days
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_since_and_ago_with_fractional_days
|
45
|
-
t = Time.local(2000)
|
46
|
-
# since
|
47
|
-
assert_equal 36.hours.since(t), 1.5.days.since(t)
|
48
|
-
assert_in_delta((24 * 1.7).hours.since(t), 1.7.days.since(t), 1)
|
49
|
-
# ago
|
50
|
-
assert_equal 36.hours.ago(t), 1.5.days.ago(t)
|
51
|
-
assert_in_delta((24 * 1.7).hours.ago(t), 1.7.days.ago(t), 1)
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_since_and_ago_with_fractional_weeks
|
55
|
-
t = Time.local(2000)
|
56
|
-
# since
|
57
|
-
assert_in_delta((7 * 36).hours.since, 1.5.weeks.since, 1)
|
58
|
-
assert_in_delta((7 * 24 * 1.7).hours.since, 1.7.weeks.since, 1)
|
59
|
-
# ago
|
60
|
-
assert_in_delta((7 * 36).hours.ago, 1.5.weeks.ago, 1)
|
61
|
-
assert_in_delta((7 * 24 * 1.7).hours.ago, 1.7.weeks.ago, 1)
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_deprecated_fractional_years
|
65
|
-
years_re = /Fractional years are not respected\. Convert value to integer before calling #years\./
|
66
|
-
assert_deprecated(years_re){1.0.years}
|
67
|
-
assert_deprecated(years_re){1.5.years}
|
68
|
-
assert_not_deprecated{1.years}
|
69
|
-
assert_deprecated(years_re){1.0.year}
|
70
|
-
assert_deprecated(years_re){1.5.year}
|
71
|
-
assert_not_deprecated{1.year}
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_deprecated_fractional_months
|
75
|
-
months_re = /Fractional months are not respected\. Convert value to integer before calling #months\./
|
76
|
-
assert_deprecated(months_re){1.5.months}
|
77
|
-
assert_deprecated(months_re){1.0.months}
|
78
|
-
assert_not_deprecated{1.months}
|
79
|
-
assert_deprecated(months_re){1.5.month}
|
80
|
-
assert_deprecated(months_re){1.0.month}
|
81
|
-
assert_not_deprecated{1.month}
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_since_and_ago_anchored_to_time_now_when_time_zone_default_not_set
|
85
|
-
Time.zone_default = nil
|
86
|
-
with_env_tz 'US/Eastern' do
|
87
|
-
Time.stubs(:now).returns Time.local(2000)
|
88
|
-
# since
|
89
|
-
assert_equal false, 5.seconds.since.is_a?(ActiveSupport::TimeWithZone)
|
90
|
-
assert_equal Time.local(2000,1,1,0,0,5), 5.seconds.since
|
91
|
-
# ago
|
92
|
-
assert_equal false, 5.seconds.ago.is_a?(ActiveSupport::TimeWithZone)
|
93
|
-
assert_equal Time.local(1999,12,31,23,59,55), 5.seconds.ago
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def test_since_and_ago_anchored_to_time_zone_now_when_time_zone_default_set
|
98
|
-
Time.zone_default = ActiveSupport::TimeZone['Eastern Time (US & Canada)']
|
99
|
-
with_env_tz 'US/Eastern' do
|
100
|
-
Time.stubs(:now).returns Time.local(2000)
|
101
|
-
# since
|
102
|
-
assert_equal true, 5.seconds.since.is_a?(ActiveSupport::TimeWithZone)
|
103
|
-
assert_equal Time.utc(2000,1,1,0,0,5), 5.seconds.since.time
|
104
|
-
assert_equal 'Eastern Time (US & Canada)', 5.seconds.since.time_zone.name
|
105
|
-
# ago
|
106
|
-
assert_equal true, 5.seconds.ago.is_a?(ActiveSupport::TimeWithZone)
|
107
|
-
assert_equal Time.utc(1999,12,31,23,59,55), 5.seconds.ago.time
|
108
|
-
assert_equal 'Eastern Time (US & Canada)', 5.seconds.ago.time_zone.name
|
109
|
-
end
|
110
|
-
ensure
|
111
|
-
Time.zone_default = nil
|
112
|
-
end
|
113
|
-
|
114
|
-
protected
|
115
|
-
def with_env_tz(new_tz = 'US/Eastern')
|
116
|
-
old_tz, ENV['TZ'] = ENV['TZ'], new_tz
|
117
|
-
yield
|
118
|
-
ensure
|
119
|
-
old_tz ? ENV['TZ'] = old_tz : ENV.delete('TZ')
|
120
|
-
end
|
121
|
-
end
|
@@ -1,97 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
|
3
|
-
Payment = Struct.new(:price)
|
4
|
-
class SummablePayment < Payment
|
5
|
-
def +(p) self.class.new(price + p.price) end
|
6
|
-
end
|
7
|
-
|
8
|
-
class EnumerableTests < Test::Unit::TestCase
|
9
|
-
def test_group_by
|
10
|
-
names = %w(marcel sam david jeremy)
|
11
|
-
klass = Struct.new(:name)
|
12
|
-
objects = (1..50).inject([]) do |people,|
|
13
|
-
p = klass.new
|
14
|
-
p.name = names.sort_by { rand }.first
|
15
|
-
people << p
|
16
|
-
end
|
17
|
-
|
18
|
-
grouped = objects.group_by { |object| object.name }
|
19
|
-
|
20
|
-
grouped.each do |name, group|
|
21
|
-
assert group.all? { |person| person.name == name }
|
22
|
-
end
|
23
|
-
|
24
|
-
assert_equal objects.uniq.map(&:name), grouped.keys
|
25
|
-
assert({}.merge(grouped), "Could not convert ActiveSupport::OrderedHash into Hash")
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_sums
|
29
|
-
assert_equal 30, [5, 15, 10].sum
|
30
|
-
assert_equal 30, [5, 15, 10].sum { |i| i }
|
31
|
-
|
32
|
-
assert_equal 'abc', %w(a b c).sum
|
33
|
-
assert_equal 'abc', %w(a b c).sum { |i| i }
|
34
|
-
|
35
|
-
payments = [ Payment.new(5), Payment.new(15), Payment.new(10) ]
|
36
|
-
assert_equal 30, payments.sum(&:price)
|
37
|
-
assert_equal 60, payments.sum { |p| p.price * 2 }
|
38
|
-
|
39
|
-
payments = [ SummablePayment.new(5), SummablePayment.new(15) ]
|
40
|
-
assert_equal SummablePayment.new(20), payments.sum
|
41
|
-
assert_equal SummablePayment.new(20), payments.sum { |p| p }
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_nil_sums
|
45
|
-
expected_raise = TypeError
|
46
|
-
|
47
|
-
assert_raise(expected_raise) { [5, 15, nil].sum }
|
48
|
-
|
49
|
-
payments = [ Payment.new(5), Payment.new(15), Payment.new(10), Payment.new(nil) ]
|
50
|
-
assert_raise(expected_raise) { payments.sum(&:price) }
|
51
|
-
|
52
|
-
assert_equal 60, payments.sum { |p| p.price.to_i * 2 }
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_empty_sums
|
56
|
-
assert_equal 0, [].sum
|
57
|
-
assert_equal 0, [].sum { |i| i }
|
58
|
-
assert_equal Payment.new(0), [].sum(Payment.new(0))
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_enumerable_sums
|
62
|
-
assert_equal 10, (1..4).sum
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_each_with_object
|
66
|
-
result = %w(foo bar).each_with_object({}) { |str, hsh| hsh[str] = str.upcase }
|
67
|
-
assert_equal({'foo' => 'FOO', 'bar' => 'BAR'}, result)
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_index_by
|
71
|
-
payments = [ Payment.new(5), Payment.new(15), Payment.new(10) ]
|
72
|
-
assert_equal({ 5 => payments[0], 15 => payments[1], 10 => payments[2] },
|
73
|
-
payments.index_by { |p| p.price })
|
74
|
-
end
|
75
|
-
|
76
|
-
def test_many
|
77
|
-
assert ![].many?
|
78
|
-
assert ![ 1 ].many?
|
79
|
-
assert [ 1, 2 ].many?
|
80
|
-
|
81
|
-
assert ![].many? {|x| x > 1 }
|
82
|
-
assert ![ 2 ].many? {|x| x > 1 }
|
83
|
-
assert ![ 1, 2 ].many? {|x| x > 1 }
|
84
|
-
assert [ 1, 2, 2 ].many? {|x| x > 1 }
|
85
|
-
end
|
86
|
-
|
87
|
-
def test_none
|
88
|
-
assert [].none?
|
89
|
-
assert [nil, false].none?
|
90
|
-
assert ![1].none?
|
91
|
-
|
92
|
-
assert [].none? {|x| x > 1 }
|
93
|
-
assert ![ 2 ].none? {|x| x > 1 }
|
94
|
-
assert ![ 1, 2 ].none? {|x| x > 1 }
|
95
|
-
assert [ 1, 1 ].none? {|x| x > 1 }
|
96
|
-
end
|
97
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
|
3
|
-
class ExceptionExtTests < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def get_exception(cls = RuntimeError, msg = nil, trace = nil)
|
6
|
-
begin raise cls, msg, (trace || caller)
|
7
|
-
rescue Exception => e # passed Exception
|
8
|
-
return e
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def setup
|
13
|
-
Exception::TraceSubstitutions.clear
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_clean_backtrace
|
17
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
18
|
-
e = get_exception RuntimeError, 'RAWR', ['bhal.rb', 'rawh hid den stuff is not here', 'almost all']
|
19
|
-
assert_kind_of Exception, e
|
20
|
-
assert_equal ['bhal.rb', 'rawh hid den stuff is not here', 'almost all'], e.clean_backtrace
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_app_backtrace
|
24
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
25
|
-
e = get_exception RuntimeError, 'RAWR', ['bhal.rb', ' vendor/file.rb some stuff', 'almost all']
|
26
|
-
assert_kind_of Exception, e
|
27
|
-
assert_equal ['bhal.rb', 'almost all'], e.application_backtrace
|
28
|
-
end
|
29
|
-
|
30
|
-
def test_app_backtrace_with_before
|
31
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
32
|
-
e = get_exception RuntimeError, 'RAWR', ['vendor/file.rb some stuff', 'bhal.rb', ' vendor/file.rb some stuff', 'almost all']
|
33
|
-
assert_kind_of Exception, e
|
34
|
-
assert_equal ['vendor/file.rb some stuff', 'bhal.rb', 'almost all'], e.application_backtrace
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_framework_backtrace_with_before
|
38
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
39
|
-
e = get_exception RuntimeError, 'RAWR', ['vendor/file.rb some stuff', 'bhal.rb', ' vendor/file.rb some stuff', 'almost all']
|
40
|
-
assert_kind_of Exception, e
|
41
|
-
assert_equal ['vendor/file.rb some stuff', ' vendor/file.rb some stuff'], e.framework_backtrace
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_backtrace_should_clean_paths
|
45
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
46
|
-
e = get_exception RuntimeError, 'RAWR', ['a/b/c/../d/../../../bhal.rb', 'rawh hid den stuff is not here', 'almost all']
|
47
|
-
assert_kind_of Exception, e
|
48
|
-
assert_equal ['bhal.rb', 'rawh hid den stuff is not here', 'almost all'], e.clean_backtrace
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_clean_message_should_clean_paths
|
52
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
53
|
-
e = get_exception RuntimeError, "I dislike a/z/x/../../b/y/../c", ['a/b/c/../d/../../../bhal.rb', 'rawh hid den stuff is not here', 'almost all']
|
54
|
-
assert_kind_of Exception, e
|
55
|
-
assert_equal "I dislike a/b/c", e.clean_message
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_app_trace_should_be_empty_when_no_app_frames
|
59
|
-
Exception::TraceSubstitutions << [/\s*hidden.*/, '']
|
60
|
-
e = get_exception RuntimeError, 'RAWR', ['vendor/file.rb some stuff', 'generated/bhal.rb', ' vendor/file.rb some stuff', 'generated/almost all']
|
61
|
-
assert_kind_of Exception, e
|
62
|
-
assert_equal [], e.application_backtrace
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_frozen_error
|
66
|
-
assert_raise(ActiveSupport::FrozenObjectError) { "foo".freeze.gsub!(/oo/,'aa') }
|
67
|
-
end
|
68
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
|
3
|
-
class AtomicWriteTest < Test::Unit::TestCase
|
4
|
-
def test_atomic_write_without_errors
|
5
|
-
contents = "Atomic Text"
|
6
|
-
File.atomic_write(file_name, Dir.pwd) do |file|
|
7
|
-
file.write(contents)
|
8
|
-
assert !File.exist?(file_name)
|
9
|
-
end
|
10
|
-
assert File.exist?(file_name)
|
11
|
-
assert_equal contents, File.read(file_name)
|
12
|
-
ensure
|
13
|
-
File.unlink(file_name) rescue nil
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_atomic_write_doesnt_write_when_block_raises
|
17
|
-
File.atomic_write(file_name) do |file|
|
18
|
-
file.write("testing")
|
19
|
-
raise "something bad"
|
20
|
-
end
|
21
|
-
rescue
|
22
|
-
assert !File.exist?(file_name)
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_atomic_write_preserves_file_permissions
|
26
|
-
contents = "Atomic Text"
|
27
|
-
File.open(file_name, "w", 0755) do |file|
|
28
|
-
file.write(contents)
|
29
|
-
assert File.exist?(file_name)
|
30
|
-
end
|
31
|
-
assert File.exist?(file_name)
|
32
|
-
assert_equal 0100755, file_mode
|
33
|
-
assert_equal contents, File.read(file_name)
|
34
|
-
|
35
|
-
File.atomic_write(file_name, Dir.pwd) do |file|
|
36
|
-
file.write(contents)
|
37
|
-
assert File.exist?(file_name)
|
38
|
-
end
|
39
|
-
assert File.exist?(file_name)
|
40
|
-
assert_equal 0100755, file_mode
|
41
|
-
assert_equal contents, File.read(file_name)
|
42
|
-
ensure
|
43
|
-
File.unlink(file_name) rescue nil
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_atomic_write_preserves_default_file_permissions
|
47
|
-
contents = "Atomic Text"
|
48
|
-
File.atomic_write(file_name, Dir.pwd) do |file|
|
49
|
-
file.write(contents)
|
50
|
-
assert !File.exist?(file_name)
|
51
|
-
end
|
52
|
-
assert File.exist?(file_name)
|
53
|
-
assert_equal 0100666 ^ File.umask, file_mode
|
54
|
-
assert_equal contents, File.read(file_name)
|
55
|
-
ensure
|
56
|
-
File.unlink(file_name) rescue nil
|
57
|
-
end
|
58
|
-
|
59
|
-
private
|
60
|
-
def file_name
|
61
|
-
"atomic.file"
|
62
|
-
end
|
63
|
-
|
64
|
-
def file_mode
|
65
|
-
File.stat(file_name).mode
|
66
|
-
end
|
67
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
|
3
|
-
class FloatExtRoundingTests < Test::Unit::TestCase
|
4
|
-
def test_round_for_positive_number
|
5
|
-
assert_equal 1, 1.4.round
|
6
|
-
assert_equal 2, 1.6.round
|
7
|
-
assert_equal 2, 1.6.round(0)
|
8
|
-
assert_equal 1.4, 1.4.round(1)
|
9
|
-
assert_equal 1.4, 1.4.round(3)
|
10
|
-
assert_equal 1.5, 1.45.round(1)
|
11
|
-
assert_equal 1.45, 1.445.round(2)
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_round_for_negative_number
|
15
|
-
assert_equal( -1, -1.4.round )
|
16
|
-
assert_equal( -2, -1.6.round )
|
17
|
-
assert_equal( -1.4, -1.4.round(1) )
|
18
|
-
assert_equal( -1.5, -1.45.round(1) )
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_round_with_negative_precision
|
22
|
-
assert_equal 123460.0, 123456.0.round(-1)
|
23
|
-
assert_equal 123500.0, 123456.0.round(-2)
|
24
|
-
end
|
25
|
-
end
|
@@ -1,1014 +0,0 @@
|
|
1
|
-
require 'abstract_unit'
|
2
|
-
require 'builder'
|
3
|
-
|
4
|
-
class HashExtTest < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@strings = { 'a' => 1, 'b' => 2 }
|
7
|
-
@symbols = { :a => 1, :b => 2 }
|
8
|
-
@mixed = { :a => 1, 'b' => 2 }
|
9
|
-
@fixnums = { 0 => 1, 1 => 2 }
|
10
|
-
if RUBY_VERSION < '1.9.0'
|
11
|
-
@illegal_symbols = { "\0" => 1, "" => 2, [] => 3 }
|
12
|
-
else
|
13
|
-
@illegal_symbols = { [] => 3 }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_methods
|
18
|
-
h = {}
|
19
|
-
assert_respond_to h, :symbolize_keys
|
20
|
-
assert_respond_to h, :symbolize_keys!
|
21
|
-
assert_respond_to h, :stringify_keys
|
22
|
-
assert_respond_to h, :stringify_keys!
|
23
|
-
assert_respond_to h, :to_options
|
24
|
-
assert_respond_to h, :to_options!
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_symbolize_keys
|
28
|
-
assert_equal @symbols, @symbols.symbolize_keys
|
29
|
-
assert_equal @symbols, @strings.symbolize_keys
|
30
|
-
assert_equal @symbols, @mixed.symbolize_keys
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_symbolize_keys!
|
34
|
-
assert_equal @symbols, @symbols.dup.symbolize_keys!
|
35
|
-
assert_equal @symbols, @strings.dup.symbolize_keys!
|
36
|
-
assert_equal @symbols, @mixed.dup.symbolize_keys!
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_symbolize_keys_preserves_keys_that_cant_be_symbolized
|
40
|
-
assert_equal @illegal_symbols, @illegal_symbols.symbolize_keys
|
41
|
-
assert_equal @illegal_symbols, @illegal_symbols.dup.symbolize_keys!
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_symbolize_keys_preserves_fixnum_keys
|
45
|
-
assert_equal @fixnums, @fixnums.symbolize_keys
|
46
|
-
assert_equal @fixnums, @fixnums.dup.symbolize_keys!
|
47
|
-
end
|
48
|
-
|
49
|
-
def test_stringify_keys
|
50
|
-
assert_equal @strings, @symbols.stringify_keys
|
51
|
-
assert_equal @strings, @strings.stringify_keys
|
52
|
-
assert_equal @strings, @mixed.stringify_keys
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_stringify_keys!
|
56
|
-
assert_equal @strings, @symbols.dup.stringify_keys!
|
57
|
-
assert_equal @strings, @strings.dup.stringify_keys!
|
58
|
-
assert_equal @strings, @mixed.dup.stringify_keys!
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_indifferent_assorted
|
62
|
-
@strings = @strings.with_indifferent_access
|
63
|
-
@symbols = @symbols.with_indifferent_access
|
64
|
-
@mixed = @mixed.with_indifferent_access
|
65
|
-
|
66
|
-
assert_equal 'a', @strings.__send__(:convert_key, :a)
|
67
|
-
|
68
|
-
assert_equal 1, @strings.fetch('a')
|
69
|
-
assert_equal 1, @strings.fetch(:a.to_s)
|
70
|
-
assert_equal 1, @strings.fetch(:a)
|
71
|
-
|
72
|
-
hashes = { :@strings => @strings, :@symbols => @symbols, :@mixed => @mixed }
|
73
|
-
method_map = { :'[]' => 1, :fetch => 1, :values_at => [1],
|
74
|
-
:has_key? => true, :include? => true, :key? => true,
|
75
|
-
:member? => true }
|
76
|
-
|
77
|
-
hashes.each do |name, hash|
|
78
|
-
method_map.sort_by { |m| m.to_s }.each do |meth, expected|
|
79
|
-
assert_equal(expected, hash.__send__(meth, 'a'),
|
80
|
-
"Calling #{name}.#{meth} 'a'")
|
81
|
-
assert_equal(expected, hash.__send__(meth, :a),
|
82
|
-
"Calling #{name}.#{meth} :a")
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
assert_equal [1, 2], @strings.values_at('a', 'b')
|
87
|
-
assert_equal [1, 2], @strings.values_at(:a, :b)
|
88
|
-
assert_equal [1, 2], @symbols.values_at('a', 'b')
|
89
|
-
assert_equal [1, 2], @symbols.values_at(:a, :b)
|
90
|
-
assert_equal [1, 2], @mixed.values_at('a', 'b')
|
91
|
-
assert_equal [1, 2], @mixed.values_at(:a, :b)
|
92
|
-
end
|
93
|
-
|
94
|
-
def test_indifferent_reading
|
95
|
-
hash = HashWithIndifferentAccess.new
|
96
|
-
hash["a"] = 1
|
97
|
-
hash["b"] = true
|
98
|
-
hash["c"] = false
|
99
|
-
hash["d"] = nil
|
100
|
-
|
101
|
-
assert_equal 1, hash[:a]
|
102
|
-
assert_equal true, hash[:b]
|
103
|
-
assert_equal false, hash[:c]
|
104
|
-
assert_equal nil, hash[:d]
|
105
|
-
assert_equal nil, hash[:e]
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_indifferent_reading_with_nonnil_default
|
109
|
-
hash = HashWithIndifferentAccess.new(1)
|
110
|
-
hash["a"] = 1
|
111
|
-
hash["b"] = true
|
112
|
-
hash["c"] = false
|
113
|
-
hash["d"] = nil
|
114
|
-
|
115
|
-
assert_equal 1, hash[:a]
|
116
|
-
assert_equal true, hash[:b]
|
117
|
-
assert_equal false, hash[:c]
|
118
|
-
assert_equal nil, hash[:d]
|
119
|
-
assert_equal 1, hash[:e]
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_indifferent_writing
|
123
|
-
hash = HashWithIndifferentAccess.new
|
124
|
-
hash[:a] = 1
|
125
|
-
hash['b'] = 2
|
126
|
-
hash[3] = 3
|
127
|
-
|
128
|
-
assert_equal hash['a'], 1
|
129
|
-
assert_equal hash['b'], 2
|
130
|
-
assert_equal hash[:a], 1
|
131
|
-
assert_equal hash[:b], 2
|
132
|
-
assert_equal hash[3], 3
|
133
|
-
end
|
134
|
-
|
135
|
-
def test_indifferent_update
|
136
|
-
hash = HashWithIndifferentAccess.new
|
137
|
-
hash[:a] = 'a'
|
138
|
-
hash['b'] = 'b'
|
139
|
-
|
140
|
-
updated_with_strings = hash.update(@strings)
|
141
|
-
updated_with_symbols = hash.update(@symbols)
|
142
|
-
updated_with_mixed = hash.update(@mixed)
|
143
|
-
|
144
|
-
assert_equal updated_with_strings[:a], 1
|
145
|
-
assert_equal updated_with_strings['a'], 1
|
146
|
-
assert_equal updated_with_strings['b'], 2
|
147
|
-
|
148
|
-
assert_equal updated_with_symbols[:a], 1
|
149
|
-
assert_equal updated_with_symbols['b'], 2
|
150
|
-
assert_equal updated_with_symbols[:b], 2
|
151
|
-
|
152
|
-
assert_equal updated_with_mixed[:a], 1
|
153
|
-
assert_equal updated_with_mixed['b'], 2
|
154
|
-
|
155
|
-
assert [updated_with_strings, updated_with_symbols, updated_with_mixed].all? { |h| h.keys.size == 2 }
|
156
|
-
end
|
157
|
-
|
158
|
-
def test_indifferent_merging
|
159
|
-
hash = HashWithIndifferentAccess.new
|
160
|
-
hash[:a] = 'failure'
|
161
|
-
hash['b'] = 'failure'
|
162
|
-
|
163
|
-
other = { 'a' => 1, :b => 2 }
|
164
|
-
|
165
|
-
merged = hash.merge(other)
|
166
|
-
|
167
|
-
assert_equal HashWithIndifferentAccess, merged.class
|
168
|
-
assert_equal 1, merged[:a]
|
169
|
-
assert_equal 2, merged['b']
|
170
|
-
|
171
|
-
hash.update(other)
|
172
|
-
|
173
|
-
assert_equal 1, hash[:a]
|
174
|
-
assert_equal 2, hash['b']
|
175
|
-
end
|
176
|
-
|
177
|
-
def test_indifferent_reverse_merging
|
178
|
-
hash = HashWithIndifferentAccess.new('some' => 'value', 'other' => 'value')
|
179
|
-
hash.reverse_merge!(:some => 'noclobber', :another => 'clobber')
|
180
|
-
assert_equal 'value', hash[:some]
|
181
|
-
assert_equal 'clobber', hash[:another]
|
182
|
-
end
|
183
|
-
|
184
|
-
def test_indifferent_deleting
|
185
|
-
get_hash = proc{ { :a => 'foo' }.with_indifferent_access }
|
186
|
-
hash = get_hash.call
|
187
|
-
assert_equal hash.delete(:a), 'foo'
|
188
|
-
assert_equal hash.delete(:a), nil
|
189
|
-
hash = get_hash.call
|
190
|
-
assert_equal hash.delete('a'), 'foo'
|
191
|
-
assert_equal hash.delete('a'), nil
|
192
|
-
end
|
193
|
-
|
194
|
-
def test_indifferent_to_hash
|
195
|
-
# Should convert to a Hash with String keys.
|
196
|
-
assert_equal @strings, @mixed.with_indifferent_access.to_hash
|
197
|
-
|
198
|
-
# Should preserve the default value.
|
199
|
-
mixed_with_default = @mixed.dup
|
200
|
-
mixed_with_default.default = '1234'
|
201
|
-
roundtrip = mixed_with_default.with_indifferent_access.to_hash
|
202
|
-
assert_equal @strings, roundtrip
|
203
|
-
assert_equal '1234', roundtrip.default
|
204
|
-
end
|
205
|
-
|
206
|
-
def test_indifferent_hash_with_array_of_hashes
|
207
|
-
hash = { "urls" => { "url" => [ { "address" => "1" }, { "address" => "2" } ] }}.with_indifferent_access
|
208
|
-
assert_equal "1", hash[:urls][:url].first[:address]
|
209
|
-
end
|
210
|
-
|
211
|
-
def test_stringify_and_symbolize_keys_on_indifferent_preserves_hash
|
212
|
-
h = HashWithIndifferentAccess.new
|
213
|
-
h[:first] = 1
|
214
|
-
h.stringify_keys!
|
215
|
-
assert_equal 1, h['first']
|
216
|
-
h = HashWithIndifferentAccess.new
|
217
|
-
h['first'] = 1
|
218
|
-
h.symbolize_keys!
|
219
|
-
assert_equal 1, h[:first]
|
220
|
-
end
|
221
|
-
|
222
|
-
def test_to_options_on_indifferent_preserves_hash
|
223
|
-
h = HashWithIndifferentAccess.new
|
224
|
-
h['first'] = 1
|
225
|
-
h.to_options!
|
226
|
-
assert_equal 1, h['first']
|
227
|
-
end
|
228
|
-
|
229
|
-
|
230
|
-
def test_indifferent_subhashes
|
231
|
-
h = {'user' => {'id' => 5}}.with_indifferent_access
|
232
|
-
['user', :user].each {|user| [:id, 'id'].each {|id| assert_equal 5, h[user][id], "h[#{user.inspect}][#{id.inspect}] should be 5"}}
|
233
|
-
|
234
|
-
h = {:user => {:id => 5}}.with_indifferent_access
|
235
|
-
['user', :user].each {|user| [:id, 'id'].each {|id| assert_equal 5, h[user][id], "h[#{user.inspect}][#{id.inspect}] should be 5"}}
|
236
|
-
end
|
237
|
-
|
238
|
-
def test_assert_valid_keys
|
239
|
-
assert_nothing_raised do
|
240
|
-
{ :failure => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
|
241
|
-
{ :failure => "stuff", :funny => "business" }.assert_valid_keys(:failure, :funny)
|
242
|
-
end
|
243
|
-
|
244
|
-
assert_raise(ArgumentError, "Unknown key(s): failore") do
|
245
|
-
{ :failore => "stuff", :funny => "business" }.assert_valid_keys([ :failure, :funny ])
|
246
|
-
{ :failore => "stuff", :funny => "business" }.assert_valid_keys(:failure, :funny)
|
247
|
-
end
|
248
|
-
end
|
249
|
-
|
250
|
-
def test_assorted_keys_not_stringified
|
251
|
-
original = {Object.new => 2, 1 => 2, [] => true}
|
252
|
-
indiff = original.with_indifferent_access
|
253
|
-
assert(!indiff.keys.any? {|k| k.kind_of? String}, "A key was converted to a string!")
|
254
|
-
end
|
255
|
-
|
256
|
-
def test_deep_merge
|
257
|
-
hash_1 = { :a => "a", :b => "b", :c => { :c1 => "c1", :c2 => "c2", :c3 => { :d1 => "d1" } } }
|
258
|
-
hash_2 = { :a => 1, :c => { :c1 => 2, :c3 => { :d2 => "d2" } } }
|
259
|
-
expected = { :a => 1, :b => "b", :c => { :c1 => 2, :c2 => "c2", :c3 => { :d1 => "d1", :d2 => "d2" } } }
|
260
|
-
assert_equal expected, hash_1.deep_merge(hash_2)
|
261
|
-
|
262
|
-
hash_1.deep_merge!(hash_2)
|
263
|
-
assert_equal expected, hash_1
|
264
|
-
end
|
265
|
-
|
266
|
-
def test_reverse_merge
|
267
|
-
defaults = { :a => "x", :b => "y", :c => 10 }.freeze
|
268
|
-
options = { :a => 1, :b => 2 }
|
269
|
-
expected = { :a => 1, :b => 2, :c => 10 }
|
270
|
-
|
271
|
-
# Should merge defaults into options, creating a new hash.
|
272
|
-
assert_equal expected, options.reverse_merge(defaults)
|
273
|
-
assert_not_equal expected, options
|
274
|
-
|
275
|
-
# Should merge! defaults into options, replacing options.
|
276
|
-
merged = options.dup
|
277
|
-
assert_equal expected, merged.reverse_merge!(defaults)
|
278
|
-
assert_equal expected, merged
|
279
|
-
|
280
|
-
# Should be an alias for reverse_merge!
|
281
|
-
merged = options.dup
|
282
|
-
assert_equal expected, merged.reverse_update(defaults)
|
283
|
-
assert_equal expected, merged
|
284
|
-
end
|
285
|
-
|
286
|
-
def test_diff
|
287
|
-
assert_equal({ :a => 2 }, { :a => 2, :b => 5 }.diff({ :a => 1, :b => 5 }))
|
288
|
-
end
|
289
|
-
|
290
|
-
def test_slice
|
291
|
-
original = { :a => 'x', :b => 'y', :c => 10 }
|
292
|
-
expected = { :a => 'x', :b => 'y' }
|
293
|
-
|
294
|
-
# Should return a new hash with only the given keys.
|
295
|
-
assert_equal expected, original.slice(:a, :b)
|
296
|
-
assert_not_equal expected, original
|
297
|
-
end
|
298
|
-
|
299
|
-
def test_slice_inplace
|
300
|
-
original = { :a => 'x', :b => 'y', :c => 10 }
|
301
|
-
expected = { :c => 10 }
|
302
|
-
|
303
|
-
# Should replace the hash with only the given keys.
|
304
|
-
assert_equal expected, original.slice!(:a, :b)
|
305
|
-
end
|
306
|
-
|
307
|
-
def test_slice_with_an_array_key
|
308
|
-
original = { :a => 'x', :b => 'y', :c => 10, [:a, :b] => "an array key" }
|
309
|
-
expected = { [:a, :b] => "an array key", :c => 10 }
|
310
|
-
|
311
|
-
# Should return a new hash with only the given keys when given an array key.
|
312
|
-
assert_equal expected, original.slice([:a, :b], :c)
|
313
|
-
assert_not_equal expected, original
|
314
|
-
end
|
315
|
-
|
316
|
-
def test_slice_inplace_with_an_array_key
|
317
|
-
original = { :a => 'x', :b => 'y', :c => 10, [:a, :b] => "an array key" }
|
318
|
-
expected = { :a => 'x', :b => 'y' }
|
319
|
-
|
320
|
-
# Should replace the hash with only the given keys when given an array key.
|
321
|
-
assert_equal expected, original.slice!([:a, :b], :c)
|
322
|
-
end
|
323
|
-
|
324
|
-
def test_slice_with_splatted_keys
|
325
|
-
original = { :a => 'x', :b => 'y', :c => 10, [:a, :b] => "an array key" }
|
326
|
-
expected = { :a => 'x', :b => "y" }
|
327
|
-
|
328
|
-
# Should grab each of the splatted keys.
|
329
|
-
assert_equal expected, original.slice(*[:a, :b])
|
330
|
-
end
|
331
|
-
|
332
|
-
def test_indifferent_slice
|
333
|
-
original = { :a => 'x', :b => 'y', :c => 10 }.with_indifferent_access
|
334
|
-
expected = { :a => 'x', :b => 'y' }.with_indifferent_access
|
335
|
-
|
336
|
-
[['a', 'b'], [:a, :b]].each do |keys|
|
337
|
-
# Should return a new hash with only the given keys.
|
338
|
-
assert_equal expected, original.slice(*keys), keys.inspect
|
339
|
-
assert_not_equal expected, original
|
340
|
-
end
|
341
|
-
end
|
342
|
-
|
343
|
-
def test_indifferent_slice_inplace
|
344
|
-
original = { :a => 'x', :b => 'y', :c => 10 }.with_indifferent_access
|
345
|
-
expected = { :c => 10 }.with_indifferent_access
|
346
|
-
|
347
|
-
[['a', 'b'], [:a, :b]].each do |keys|
|
348
|
-
# Should replace the hash with only the given keys.
|
349
|
-
copy = original.dup
|
350
|
-
assert_equal expected, copy.slice!(*keys)
|
351
|
-
end
|
352
|
-
end
|
353
|
-
|
354
|
-
def test_indifferent_slice_access_with_symbols
|
355
|
-
original = {'login' => 'bender', 'password' => 'shiny', 'stuff' => 'foo'}
|
356
|
-
original = original.with_indifferent_access
|
357
|
-
|
358
|
-
slice = original.slice(:login, :password)
|
359
|
-
|
360
|
-
assert_equal 'bender', slice[:login]
|
361
|
-
assert_equal 'bender', slice['login']
|
362
|
-
end
|
363
|
-
|
364
|
-
def test_except
|
365
|
-
original = { :a => 'x', :b => 'y', :c => 10 }
|
366
|
-
expected = { :a => 'x', :b => 'y' }
|
367
|
-
|
368
|
-
# Should return a new hash with only the given keys.
|
369
|
-
assert_equal expected, original.except(:c)
|
370
|
-
assert_not_equal expected, original
|
371
|
-
|
372
|
-
# Should replace the hash with only the given keys.
|
373
|
-
assert_equal expected, original.except!(:c)
|
374
|
-
assert_equal expected, original
|
375
|
-
end
|
376
|
-
|
377
|
-
def test_except_with_original_frozen
|
378
|
-
original = { :a => 'x', :b => 'y' }
|
379
|
-
original.freeze
|
380
|
-
assert_nothing_raised { original.except(:a) }
|
381
|
-
end
|
382
|
-
|
383
|
-
def test_except_with_mocha_expectation_on_original
|
384
|
-
original = { :a => 'x', :b => 'y' }
|
385
|
-
original.expects(:delete).never
|
386
|
-
original.except(:a)
|
387
|
-
end
|
388
|
-
end
|
389
|
-
|
390
|
-
class IWriteMyOwnXML
|
391
|
-
def to_xml(options = {})
|
392
|
-
options[:indent] ||= 2
|
393
|
-
xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
|
394
|
-
xml.instruct! unless options[:skip_instruct]
|
395
|
-
xml.level_one do
|
396
|
-
xml.tag!(:second_level, 'content')
|
397
|
-
end
|
398
|
-
end
|
399
|
-
end
|
400
|
-
|
401
|
-
class HashToXmlTest < Test::Unit::TestCase
|
402
|
-
def setup
|
403
|
-
@xml_options = { :root => :person, :skip_instruct => true, :indent => 0 }
|
404
|
-
end
|
405
|
-
|
406
|
-
def test_default_values_for_rename_keys
|
407
|
-
assert_equal true,ActiveSupport.dasherize_xml
|
408
|
-
assert_equal false,ActiveSupport.camelize_xml
|
409
|
-
end
|
410
|
-
|
411
|
-
def test_one_level
|
412
|
-
xml = { :name => "David", :street => "Paulina" }.to_xml(@xml_options)
|
413
|
-
assert_equal "<person>", xml.first(8)
|
414
|
-
assert xml.include?(%(<street>Paulina</street>))
|
415
|
-
assert xml.include?(%(<name>David</name>))
|
416
|
-
end
|
417
|
-
# we add :camelize => false because otherwise we'd be accidentally testing the default value for :camelize
|
418
|
-
def test_one_level_dasherize_false
|
419
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:dasherize => false,:camelize=>false))
|
420
|
-
assert_equal "<person>", xml.first(8)
|
421
|
-
assert xml.include?(%(<street_name>Paulina</street_name>))
|
422
|
-
assert xml.include?(%(<name>David</name>))
|
423
|
-
end
|
424
|
-
|
425
|
-
def test_one_level_dasherize_true
|
426
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:dasherize => true,:camelize=>false))
|
427
|
-
assert_equal "<person>", xml.first(8)
|
428
|
-
assert xml.include?(%(<street-name>Paulina</street-name>))
|
429
|
-
assert xml.include?(%(<name>David</name>))
|
430
|
-
end
|
431
|
-
|
432
|
-
def test_one_level_dasherize_default_false
|
433
|
-
current_default = ActiveSupport.dasherize_xml
|
434
|
-
ActiveSupport.dasherize_xml = false
|
435
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:camelize=>false))
|
436
|
-
assert_equal "<person>", xml.first(8)
|
437
|
-
assert xml.include?(%(<street_name>Paulina</street_name>))
|
438
|
-
assert xml.include?(%(<name>David</name>))
|
439
|
-
ensure
|
440
|
-
ActiveSupport.dasherize_xml = current_default
|
441
|
-
end
|
442
|
-
|
443
|
-
def test_one_level_dasherize_default_true
|
444
|
-
current_default = ActiveSupport.dasherize_xml
|
445
|
-
ActiveSupport.dasherize_xml = true
|
446
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:camelize=>false))
|
447
|
-
assert_equal "<person>", xml.first(8)
|
448
|
-
assert xml.include?(%(<street-name>Paulina</street-name>))
|
449
|
-
assert xml.include?(%(<name>David</name>))
|
450
|
-
ensure
|
451
|
-
ActiveSupport.dasherize_xml = current_default
|
452
|
-
end
|
453
|
-
|
454
|
-
def test_one_level_camelize_true
|
455
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:camelize => true,:dasherize => false))
|
456
|
-
assert_equal "<Person>", xml.first(8)
|
457
|
-
assert xml.include?(%(<StreetName>Paulina</StreetName>))
|
458
|
-
assert xml.include?(%(<Name>David</Name>))
|
459
|
-
end
|
460
|
-
|
461
|
-
#camelize=>false is already tested above
|
462
|
-
|
463
|
-
def test_one_level_camelize_default_false
|
464
|
-
current_default = ActiveSupport.camelize_xml
|
465
|
-
ActiveSupport.camelize_xml = false
|
466
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:dasherize => false))
|
467
|
-
assert_equal "<person>", xml.first(8)
|
468
|
-
assert xml.include?(%(<street_name>Paulina</street_name>))
|
469
|
-
assert xml.include?(%(<name>David</name>))
|
470
|
-
ensure
|
471
|
-
ActiveSupport.camelize_xml = current_default
|
472
|
-
end
|
473
|
-
|
474
|
-
def test_one_level_camelize_default_true
|
475
|
-
current_default = ActiveSupport.camelize_xml
|
476
|
-
ActiveSupport.camelize_xml = true
|
477
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:dasherize => false))
|
478
|
-
assert_equal "<Person>", xml.first(8)
|
479
|
-
assert xml.include?(%(<StreetName>Paulina</StreetName>))
|
480
|
-
assert xml.include?(%(<Name>David</Name>))
|
481
|
-
ensure
|
482
|
-
ActiveSupport.camelize_xml = current_default
|
483
|
-
end
|
484
|
-
|
485
|
-
def test_one_level_camelize_true_dasherize_true
|
486
|
-
xml = { :name => "David", :street_name => "Paulina" }.to_xml(@xml_options.merge(:dasherize => true,:camelize=>true))
|
487
|
-
assert_equal "<Person>", xml.first(8)
|
488
|
-
assert xml.include?(%(<StreetName>Paulina</StreetName>))
|
489
|
-
assert xml.include?(%(<Name>David</Name>))
|
490
|
-
end
|
491
|
-
|
492
|
-
def test_one_level_with_types
|
493
|
-
xml = { :name => "David", :street => "Paulina", :age => 26, :age_in_millis => 820497600000, :moved_on => Date.new(2005, 11, 15), :resident => :yes }.to_xml(@xml_options)
|
494
|
-
assert_equal "<person>", xml.first(8)
|
495
|
-
assert xml.include?(%(<street>Paulina</street>))
|
496
|
-
assert xml.include?(%(<name>David</name>))
|
497
|
-
assert xml.include?(%(<age type="integer">26</age>))
|
498
|
-
assert xml.include?(%(<age-in-millis type="integer">820497600000</age-in-millis>))
|
499
|
-
assert xml.include?(%(<moved-on type="date">2005-11-15</moved-on>))
|
500
|
-
assert xml.include?(%(<resident type="symbol">yes</resident>))
|
501
|
-
end
|
502
|
-
|
503
|
-
def test_one_level_with_nils
|
504
|
-
xml = { :name => "David", :street => "Paulina", :age => nil }.to_xml(@xml_options)
|
505
|
-
assert_equal "<person>", xml.first(8)
|
506
|
-
assert xml.include?(%(<street>Paulina</street>))
|
507
|
-
assert xml.include?(%(<name>David</name>))
|
508
|
-
assert xml.include?(%(<age nil="true"></age>))
|
509
|
-
end
|
510
|
-
|
511
|
-
def test_one_level_with_skipping_types
|
512
|
-
xml = { :name => "David", :street => "Paulina", :age => nil }.to_xml(@xml_options.merge(:skip_types => true))
|
513
|
-
assert_equal "<person>", xml.first(8)
|
514
|
-
assert xml.include?(%(<street>Paulina</street>))
|
515
|
-
assert xml.include?(%(<name>David</name>))
|
516
|
-
assert xml.include?(%(<age nil="true"></age>))
|
517
|
-
end
|
518
|
-
|
519
|
-
def test_one_level_with_yielding
|
520
|
-
xml = { :name => "David", :street => "Paulina" }.to_xml(@xml_options) do |x|
|
521
|
-
x.creator("Rails")
|
522
|
-
end
|
523
|
-
|
524
|
-
assert_equal "<person>", xml.first(8)
|
525
|
-
assert xml.include?(%(<street>Paulina</street>))
|
526
|
-
assert xml.include?(%(<name>David</name>))
|
527
|
-
assert xml.include?(%(<creator>Rails</creator>))
|
528
|
-
end
|
529
|
-
|
530
|
-
def test_two_levels
|
531
|
-
xml = { :name => "David", :address => { :street => "Paulina" } }.to_xml(@xml_options)
|
532
|
-
assert_equal "<person>", xml.first(8)
|
533
|
-
assert xml.include?(%(<address><street>Paulina</street></address>))
|
534
|
-
assert xml.include?(%(<name>David</name>))
|
535
|
-
end
|
536
|
-
|
537
|
-
def test_two_levels_with_second_level_overriding_to_xml
|
538
|
-
xml = { :name => "David", :address => { :street => "Paulina" }, :child => IWriteMyOwnXML.new }.to_xml(@xml_options)
|
539
|
-
assert_equal "<person>", xml.first(8)
|
540
|
-
assert xml.include?(%(<address><street>Paulina</street></address>))
|
541
|
-
assert xml.include?(%(<level_one><second_level>content</second_level></level_one>))
|
542
|
-
end
|
543
|
-
|
544
|
-
def test_two_levels_with_array
|
545
|
-
xml = { :name => "David", :addresses => [{ :street => "Paulina" }, { :street => "Evergreen" }] }.to_xml(@xml_options)
|
546
|
-
assert_equal "<person>", xml.first(8)
|
547
|
-
assert xml.include?(%(<addresses type="array"><address>))
|
548
|
-
assert xml.include?(%(<address><street>Paulina</street></address>))
|
549
|
-
assert xml.include?(%(<address><street>Evergreen</street></address>))
|
550
|
-
assert xml.include?(%(<name>David</name>))
|
551
|
-
end
|
552
|
-
|
553
|
-
def test_three_levels_with_array
|
554
|
-
xml = { :name => "David", :addresses => [{ :streets => [ { :name => "Paulina" }, { :name => "Paulina" } ] } ] }.to_xml(@xml_options)
|
555
|
-
assert xml.include?(%(<addresses type="array"><address><streets type="array"><street><name>))
|
556
|
-
end
|
557
|
-
|
558
|
-
def test_timezoned_attributes
|
559
|
-
xml = {
|
560
|
-
:created_at => Time.utc(1999,2,2),
|
561
|
-
:local_created_at => Time.utc(1999,2,2).in_time_zone('Eastern Time (US & Canada)')
|
562
|
-
}.to_xml(@xml_options)
|
563
|
-
assert_match %r{<created-at type=\"datetime\">1999-02-02T00:00:00Z</created-at>}, xml
|
564
|
-
assert_match %r{<local-created-at type=\"datetime\">1999-02-01T19:00:00-05:00</local-created-at>}, xml
|
565
|
-
end
|
566
|
-
|
567
|
-
def test_single_record_from_xml
|
568
|
-
topic_xml = <<-EOT
|
569
|
-
<topic>
|
570
|
-
<title>The First Topic</title>
|
571
|
-
<author-name>David</author-name>
|
572
|
-
<id type="integer">1</id>
|
573
|
-
<approved type="boolean"> true </approved>
|
574
|
-
<replies-count type="integer">0</replies-count>
|
575
|
-
<replies-close-in type="integer">2592000000</replies-close-in>
|
576
|
-
<written-on type="date">2003-07-16</written-on>
|
577
|
-
<viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
|
578
|
-
<content type="yaml">--- \n1: should be an integer\n:message: Have a nice day\narray: \n- should-have-dashes: true\n should_have_underscores: true\n</content>
|
579
|
-
<author-email-address>david@loudthinking.com</author-email-address>
|
580
|
-
<parent-id></parent-id>
|
581
|
-
<ad-revenue type="decimal">1.5</ad-revenue>
|
582
|
-
<optimum-viewing-angle type="float">135</optimum-viewing-angle>
|
583
|
-
<resident type="symbol">yes</resident>
|
584
|
-
</topic>
|
585
|
-
EOT
|
586
|
-
|
587
|
-
expected_topic_hash = {
|
588
|
-
:title => "The First Topic",
|
589
|
-
:author_name => "David",
|
590
|
-
:id => 1,
|
591
|
-
:approved => true,
|
592
|
-
:replies_count => 0,
|
593
|
-
:replies_close_in => 2592000000,
|
594
|
-
:written_on => Date.new(2003, 7, 16),
|
595
|
-
:viewed_at => Time.utc(2003, 7, 16, 9, 28),
|
596
|
-
:content => { :message => "Have a nice day", 1 => "should be an integer", "array" => [{ "should-have-dashes" => true, "should_have_underscores" => true }] },
|
597
|
-
:author_email_address => "david@loudthinking.com",
|
598
|
-
:parent_id => nil,
|
599
|
-
:ad_revenue => BigDecimal("1.50"),
|
600
|
-
:optimum_viewing_angle => 135.0,
|
601
|
-
:resident => :yes
|
602
|
-
}.stringify_keys
|
603
|
-
|
604
|
-
assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["topic"]
|
605
|
-
end
|
606
|
-
|
607
|
-
def test_single_record_from_xml_with_nil_values
|
608
|
-
topic_xml = <<-EOT
|
609
|
-
<topic>
|
610
|
-
<title></title>
|
611
|
-
<id type="integer"></id>
|
612
|
-
<approved type="boolean"></approved>
|
613
|
-
<written-on type="date"></written-on>
|
614
|
-
<viewed-at type="datetime"></viewed-at>
|
615
|
-
<content type="yaml"></content>
|
616
|
-
<parent-id></parent-id>
|
617
|
-
</topic>
|
618
|
-
EOT
|
619
|
-
|
620
|
-
expected_topic_hash = {
|
621
|
-
:title => nil,
|
622
|
-
:id => nil,
|
623
|
-
:approved => nil,
|
624
|
-
:written_on => nil,
|
625
|
-
:viewed_at => nil,
|
626
|
-
:content => nil,
|
627
|
-
:parent_id => nil
|
628
|
-
}.stringify_keys
|
629
|
-
|
630
|
-
assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["topic"]
|
631
|
-
end
|
632
|
-
|
633
|
-
def test_multiple_records_from_xml
|
634
|
-
topics_xml = <<-EOT
|
635
|
-
<topics type="array">
|
636
|
-
<topic>
|
637
|
-
<title>The First Topic</title>
|
638
|
-
<author-name>David</author-name>
|
639
|
-
<id type="integer">1</id>
|
640
|
-
<approved type="boolean">false</approved>
|
641
|
-
<replies-count type="integer">0</replies-count>
|
642
|
-
<replies-close-in type="integer">2592000000</replies-close-in>
|
643
|
-
<written-on type="date">2003-07-16</written-on>
|
644
|
-
<viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
|
645
|
-
<content>Have a nice day</content>
|
646
|
-
<author-email-address>david@loudthinking.com</author-email-address>
|
647
|
-
<parent-id nil="true"></parent-id>
|
648
|
-
</topic>
|
649
|
-
<topic>
|
650
|
-
<title>The Second Topic</title>
|
651
|
-
<author-name>Jason</author-name>
|
652
|
-
<id type="integer">1</id>
|
653
|
-
<approved type="boolean">false</approved>
|
654
|
-
<replies-count type="integer">0</replies-count>
|
655
|
-
<replies-close-in type="integer">2592000000</replies-close-in>
|
656
|
-
<written-on type="date">2003-07-16</written-on>
|
657
|
-
<viewed-at type="datetime">2003-07-16T09:28:00+0000</viewed-at>
|
658
|
-
<content>Have a nice day</content>
|
659
|
-
<author-email-address>david@loudthinking.com</author-email-address>
|
660
|
-
<parent-id></parent-id>
|
661
|
-
</topic>
|
662
|
-
</topics>
|
663
|
-
EOT
|
664
|
-
|
665
|
-
expected_topic_hash = {
|
666
|
-
:title => "The First Topic",
|
667
|
-
:author_name => "David",
|
668
|
-
:id => 1,
|
669
|
-
:approved => false,
|
670
|
-
:replies_count => 0,
|
671
|
-
:replies_close_in => 2592000000,
|
672
|
-
:written_on => Date.new(2003, 7, 16),
|
673
|
-
:viewed_at => Time.utc(2003, 7, 16, 9, 28),
|
674
|
-
:content => "Have a nice day",
|
675
|
-
:author_email_address => "david@loudthinking.com",
|
676
|
-
:parent_id => nil
|
677
|
-
}.stringify_keys
|
678
|
-
|
679
|
-
assert_equal expected_topic_hash, Hash.from_xml(topics_xml)["topics"].first
|
680
|
-
end
|
681
|
-
|
682
|
-
def test_single_record_from_xml_with_attributes_other_than_type
|
683
|
-
topic_xml = <<-EOT
|
684
|
-
<rsp stat="ok">
|
685
|
-
<photos page="1" pages="1" perpage="100" total="16">
|
686
|
-
<photo id="175756086" owner="55569174@N00" secret="0279bf37a1" server="76" title="Colored Pencil PhotoBooth Fun" ispublic="1" isfriend="0" isfamily="0"/>
|
687
|
-
</photos>
|
688
|
-
</rsp>
|
689
|
-
EOT
|
690
|
-
|
691
|
-
expected_topic_hash = {
|
692
|
-
:id => "175756086",
|
693
|
-
:owner => "55569174@N00",
|
694
|
-
:secret => "0279bf37a1",
|
695
|
-
:server => "76",
|
696
|
-
:title => "Colored Pencil PhotoBooth Fun",
|
697
|
-
:ispublic => "1",
|
698
|
-
:isfriend => "0",
|
699
|
-
:isfamily => "0",
|
700
|
-
}.stringify_keys
|
701
|
-
|
702
|
-
assert_equal expected_topic_hash, Hash.from_xml(topic_xml)["rsp"]["photos"]["photo"]
|
703
|
-
end
|
704
|
-
|
705
|
-
def test_empty_array_from_xml
|
706
|
-
blog_xml = <<-XML
|
707
|
-
<blog>
|
708
|
-
<posts type="array"></posts>
|
709
|
-
</blog>
|
710
|
-
XML
|
711
|
-
expected_blog_hash = {"blog" => {"posts" => []}}
|
712
|
-
assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
|
713
|
-
end
|
714
|
-
|
715
|
-
def test_all_caps_key_from_xml
|
716
|
-
test_xml = <<-EOT
|
717
|
-
<ABC3XYZ>
|
718
|
-
<TEST>Lorem Ipsum</TEST>
|
719
|
-
</ABC3XYZ>
|
720
|
-
EOT
|
721
|
-
|
722
|
-
expected_hash = {
|
723
|
-
"ABC3XYZ" => {
|
724
|
-
"TEST" => "Lorem Ipsum"
|
725
|
-
}
|
726
|
-
}
|
727
|
-
|
728
|
-
assert_equal expected_hash, Hash.from_xml(test_xml)
|
729
|
-
end
|
730
|
-
|
731
|
-
def test_empty_array_with_whitespace_from_xml
|
732
|
-
blog_xml = <<-XML
|
733
|
-
<blog>
|
734
|
-
<posts type="array">
|
735
|
-
</posts>
|
736
|
-
</blog>
|
737
|
-
XML
|
738
|
-
expected_blog_hash = {"blog" => {"posts" => []}}
|
739
|
-
assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
|
740
|
-
end
|
741
|
-
|
742
|
-
def test_array_with_one_entry_from_xml
|
743
|
-
blog_xml = <<-XML
|
744
|
-
<blog>
|
745
|
-
<posts type="array">
|
746
|
-
<post>a post</post>
|
747
|
-
</posts>
|
748
|
-
</blog>
|
749
|
-
XML
|
750
|
-
expected_blog_hash = {"blog" => {"posts" => ["a post"]}}
|
751
|
-
assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
|
752
|
-
end
|
753
|
-
|
754
|
-
def test_array_with_multiple_entries_from_xml
|
755
|
-
blog_xml = <<-XML
|
756
|
-
<blog>
|
757
|
-
<posts type="array">
|
758
|
-
<post>a post</post>
|
759
|
-
<post>another post</post>
|
760
|
-
</posts>
|
761
|
-
</blog>
|
762
|
-
XML
|
763
|
-
expected_blog_hash = {"blog" => {"posts" => ["a post", "another post"]}}
|
764
|
-
assert_equal expected_blog_hash, Hash.from_xml(blog_xml)
|
765
|
-
end
|
766
|
-
|
767
|
-
def test_file_from_xml
|
768
|
-
blog_xml = <<-XML
|
769
|
-
<blog>
|
770
|
-
<logo type="file" name="logo.png" content_type="image/png">
|
771
|
-
</logo>
|
772
|
-
</blog>
|
773
|
-
XML
|
774
|
-
hash = Hash.from_xml(blog_xml)
|
775
|
-
assert hash.has_key?('blog')
|
776
|
-
assert hash['blog'].has_key?('logo')
|
777
|
-
|
778
|
-
file = hash['blog']['logo']
|
779
|
-
assert_equal 'logo.png', file.original_filename
|
780
|
-
assert_equal 'image/png', file.content_type
|
781
|
-
end
|
782
|
-
|
783
|
-
def test_file_from_xml_with_defaults
|
784
|
-
blog_xml = <<-XML
|
785
|
-
<blog>
|
786
|
-
<logo type="file">
|
787
|
-
</logo>
|
788
|
-
</blog>
|
789
|
-
XML
|
790
|
-
file = Hash.from_xml(blog_xml)['blog']['logo']
|
791
|
-
assert_equal 'untitled', file.original_filename
|
792
|
-
assert_equal 'application/octet-stream', file.content_type
|
793
|
-
end
|
794
|
-
|
795
|
-
def test_xsd_like_types_from_xml
|
796
|
-
bacon_xml = <<-EOT
|
797
|
-
<bacon>
|
798
|
-
<weight type="double">0.5</weight>
|
799
|
-
<price type="decimal">12.50</price>
|
800
|
-
<chunky type="boolean"> 1 </chunky>
|
801
|
-
<expires-at type="dateTime">2007-12-25T12:34:56+0000</expires-at>
|
802
|
-
<notes type="string"></notes>
|
803
|
-
<illustration type="base64Binary">YmFiZS5wbmc=</illustration>
|
804
|
-
</bacon>
|
805
|
-
EOT
|
806
|
-
|
807
|
-
expected_bacon_hash = {
|
808
|
-
:weight => 0.5,
|
809
|
-
:chunky => true,
|
810
|
-
:price => BigDecimal("12.50"),
|
811
|
-
:expires_at => Time.utc(2007,12,25,12,34,56),
|
812
|
-
:notes => "",
|
813
|
-
:illustration => "babe.png"
|
814
|
-
}.stringify_keys
|
815
|
-
|
816
|
-
assert_equal expected_bacon_hash, Hash.from_xml(bacon_xml)["bacon"]
|
817
|
-
end
|
818
|
-
|
819
|
-
def test_type_trickles_through_when_unknown
|
820
|
-
product_xml = <<-EOT
|
821
|
-
<product>
|
822
|
-
<weight type="double">0.5</weight>
|
823
|
-
<image type="ProductImage"><filename>image.gif</filename></image>
|
824
|
-
|
825
|
-
</product>
|
826
|
-
EOT
|
827
|
-
|
828
|
-
expected_product_hash = {
|
829
|
-
:weight => 0.5,
|
830
|
-
:image => {'type' => 'ProductImage', 'filename' => 'image.gif' },
|
831
|
-
}.stringify_keys
|
832
|
-
|
833
|
-
assert_equal expected_product_hash, Hash.from_xml(product_xml)["product"]
|
834
|
-
end
|
835
|
-
|
836
|
-
def test_should_use_default_value_for_unknown_key
|
837
|
-
hash_wia = HashWithIndifferentAccess.new(3)
|
838
|
-
assert_equal 3, hash_wia[:new_key]
|
839
|
-
end
|
840
|
-
|
841
|
-
def test_should_use_default_value_if_no_key_is_supplied
|
842
|
-
hash_wia = HashWithIndifferentAccess.new(3)
|
843
|
-
assert_equal 3, hash_wia.default
|
844
|
-
end
|
845
|
-
|
846
|
-
def test_should_nil_if_no_default_value_is_supplied
|
847
|
-
hash_wia = HashWithIndifferentAccess.new
|
848
|
-
assert_nil hash_wia.default
|
849
|
-
end
|
850
|
-
|
851
|
-
def test_should_copy_the_default_value_when_converting_to_hash_with_indifferent_access
|
852
|
-
hash = Hash.new(3)
|
853
|
-
hash_wia = hash.with_indifferent_access
|
854
|
-
assert_equal 3, hash_wia.default
|
855
|
-
end
|
856
|
-
|
857
|
-
# The XML builder seems to fail miserably when trying to tag something
|
858
|
-
# with the same name as a Kernel method (throw, test, loop, select ...)
|
859
|
-
def test_kernel_method_names_to_xml
|
860
|
-
hash = { :throw => { :ball => 'red' } }
|
861
|
-
expected = '<person><throw><ball>red</ball></throw></person>'
|
862
|
-
|
863
|
-
assert_nothing_raised do
|
864
|
-
assert_equal expected, hash.to_xml(@xml_options)
|
865
|
-
end
|
866
|
-
end
|
867
|
-
|
868
|
-
def test_empty_string_works_for_typecast_xml_value
|
869
|
-
assert_nothing_raised do
|
870
|
-
Hash.__send__(:typecast_xml_value, "")
|
871
|
-
end
|
872
|
-
end
|
873
|
-
|
874
|
-
def test_escaping_to_xml
|
875
|
-
hash = {
|
876
|
-
:bare_string => 'First & Last Name',
|
877
|
-
:pre_escaped_string => 'First & Last Name'
|
878
|
-
}.stringify_keys
|
879
|
-
|
880
|
-
expected_xml = '<person><bare-string>First & Last Name</bare-string><pre-escaped-string>First &amp; Last Name</pre-escaped-string></person>'
|
881
|
-
assert_equal expected_xml, hash.to_xml(@xml_options)
|
882
|
-
end
|
883
|
-
|
884
|
-
def test_unescaping_from_xml
|
885
|
-
xml_string = '<person><bare-string>First & Last Name</bare-string><pre-escaped-string>First &amp; Last Name</pre-escaped-string></person>'
|
886
|
-
expected_hash = {
|
887
|
-
:bare_string => 'First & Last Name',
|
888
|
-
:pre_escaped_string => 'First & Last Name'
|
889
|
-
}.stringify_keys
|
890
|
-
assert_equal expected_hash, Hash.from_xml(xml_string)['person']
|
891
|
-
end
|
892
|
-
|
893
|
-
def test_roundtrip_to_xml_from_xml
|
894
|
-
hash = {
|
895
|
-
:bare_string => 'First & Last Name',
|
896
|
-
:pre_escaped_string => 'First & Last Name'
|
897
|
-
}.stringify_keys
|
898
|
-
|
899
|
-
assert_equal hash, Hash.from_xml(hash.to_xml(@xml_options))['person']
|
900
|
-
end
|
901
|
-
|
902
|
-
def test_to_xml_dups_options
|
903
|
-
options = {:skip_instruct => true}
|
904
|
-
{}.to_xml(options)
|
905
|
-
# :builder, etc, shouldn't be added to options
|
906
|
-
assert_equal({:skip_instruct => true}, options)
|
907
|
-
end
|
908
|
-
|
909
|
-
def test_datetime_xml_type_with_utc_time
|
910
|
-
alert_xml = <<-XML
|
911
|
-
<alert>
|
912
|
-
<alert_at type="datetime">2008-02-10T15:30:45Z</alert_at>
|
913
|
-
</alert>
|
914
|
-
XML
|
915
|
-
alert_at = Hash.from_xml(alert_xml)['alert']['alert_at']
|
916
|
-
assert alert_at.utc?
|
917
|
-
assert_equal Time.utc(2008, 2, 10, 15, 30, 45), alert_at
|
918
|
-
end
|
919
|
-
|
920
|
-
def test_datetime_xml_type_with_non_utc_time
|
921
|
-
alert_xml = <<-XML
|
922
|
-
<alert>
|
923
|
-
<alert_at type="datetime">2008-02-10T10:30:45-05:00</alert_at>
|
924
|
-
</alert>
|
925
|
-
XML
|
926
|
-
alert_at = Hash.from_xml(alert_xml)['alert']['alert_at']
|
927
|
-
assert alert_at.utc?
|
928
|
-
assert_equal Time.utc(2008, 2, 10, 15, 30, 45), alert_at
|
929
|
-
end
|
930
|
-
|
931
|
-
def test_datetime_xml_type_with_far_future_date
|
932
|
-
alert_xml = <<-XML
|
933
|
-
<alert>
|
934
|
-
<alert_at type="datetime">2050-02-10T15:30:45Z</alert_at>
|
935
|
-
</alert>
|
936
|
-
XML
|
937
|
-
alert_at = Hash.from_xml(alert_xml)['alert']['alert_at']
|
938
|
-
assert alert_at.utc?
|
939
|
-
assert_equal 2050, alert_at.year
|
940
|
-
assert_equal 2, alert_at.month
|
941
|
-
assert_equal 10, alert_at.day
|
942
|
-
assert_equal 15, alert_at.hour
|
943
|
-
assert_equal 30, alert_at.min
|
944
|
-
assert_equal 45, alert_at.sec
|
945
|
-
end
|
946
|
-
end
|
947
|
-
|
948
|
-
class QueryTest < Test::Unit::TestCase
|
949
|
-
def test_simple_conversion
|
950
|
-
assert_query_equal 'a=10', :a => 10
|
951
|
-
end
|
952
|
-
|
953
|
-
def test_cgi_escaping
|
954
|
-
assert_query_equal 'a%3Ab=c+d', 'a:b' => 'c d'
|
955
|
-
end
|
956
|
-
|
957
|
-
def test_nil_parameter_value
|
958
|
-
empty = Object.new
|
959
|
-
def empty.to_param; nil end
|
960
|
-
assert_query_equal 'a=', 'a' => empty
|
961
|
-
end
|
962
|
-
|
963
|
-
def test_nested_conversion
|
964
|
-
assert_query_equal 'person%5Blogin%5D=seckar&person%5Bname%5D=Nicholas',
|
965
|
-
:person => {:name => 'Nicholas', :login => 'seckar'}
|
966
|
-
end
|
967
|
-
|
968
|
-
def test_multiple_nested
|
969
|
-
assert_query_equal 'account%5Bperson%5D%5Bid%5D=20&person%5Bid%5D=10',
|
970
|
-
:person => {:id => 10}, :account => {:person => {:id => 20}}
|
971
|
-
end
|
972
|
-
|
973
|
-
def test_array_values
|
974
|
-
assert_query_equal 'person%5Bid%5D%5B%5D=10&person%5Bid%5D%5B%5D=20',
|
975
|
-
:person => {:id => [10, 20]}
|
976
|
-
end
|
977
|
-
|
978
|
-
def test_array_values_are_not_sorted
|
979
|
-
assert_query_equal 'person%5Bid%5D%5B%5D=20&person%5Bid%5D%5B%5D=10',
|
980
|
-
:person => {:id => [20, 10]}
|
981
|
-
end
|
982
|
-
|
983
|
-
def test_expansion_count_is_limited
|
984
|
-
expected = {
|
985
|
-
'ActiveSupport::XmlMini_REXML' => 'RuntimeError',
|
986
|
-
'ActiveSupport::XmlMini_Nokogiri' => 'Nokogiri::XML::SyntaxError',
|
987
|
-
'ActiveSupport::XmlMini_LibXML' => 'LibXML::XML::Error',
|
988
|
-
}[ActiveSupport::XmlMini.backend.name].constantize
|
989
|
-
|
990
|
-
assert_raise expected do
|
991
|
-
attack_xml = <<-EOT
|
992
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
993
|
-
<!DOCTYPE member [
|
994
|
-
<!ENTITY a "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
|
995
|
-
<!ENTITY b "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
|
996
|
-
<!ENTITY c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
|
997
|
-
<!ENTITY d "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
|
998
|
-
<!ENTITY e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
|
999
|
-
<!ENTITY f "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
|
1000
|
-
<!ENTITY g "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
|
1001
|
-
]>
|
1002
|
-
<member>
|
1003
|
-
&a;
|
1004
|
-
</member>
|
1005
|
-
EOT
|
1006
|
-
Hash.from_xml(attack_xml)
|
1007
|
-
end
|
1008
|
-
end
|
1009
|
-
|
1010
|
-
private
|
1011
|
-
def assert_query_equal(expected, actual, message = nil)
|
1012
|
-
assert_equal expected.split('&'), actual.to_query.split('&')
|
1013
|
-
end
|
1014
|
-
end
|