picolena 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +11 -4
- data/Manifest.txt +1 -0
- data/README.txt +2 -2
- data/bin/picolena +1 -1
- data/config/hoe.rb +10 -10
- data/lib/picolena/USAGE +1 -1
- data/lib/picolena/config/basic.rb +11 -11
- data/lib/picolena/picolena_generator.rb +15 -14
- data/lib/picolena/templates/app/controllers/application.rb +5 -5
- data/lib/picolena/templates/app/controllers/documents_controller.rb +17 -9
- data/lib/picolena/templates/app/helpers/documents_helper.rb +15 -14
- data/lib/picolena/templates/app/models/document.rb +28 -37
- data/lib/picolena/templates/app/models/finder.rb +12 -37
- data/lib/picolena/templates/app/models/indexer.rb +58 -37
- data/lib/picolena/templates/app/models/plain_text_extractor.rb +16 -16
- data/lib/picolena/templates/app/models/query.rb +5 -5
- data/lib/picolena/templates/app/views/documents/show.html.haml +3 -3
- data/lib/picolena/templates/app/views/layouts/application.html.haml +2 -2
- data/lib/picolena/templates/config/environment.rb +1 -1
- data/lib/picolena/templates/config/initializers/002_load_indexed_dirs.rb +8 -8
- data/lib/picolena/templates/config/initializers/003_load_white_list_IPs.rb +8 -8
- data/lib/picolena/templates/config/initializers/005_load_custom_title_and_names_and_links.rb +5 -5
- data/lib/picolena/templates/config/initializers/006_load_icons.rb +9 -7
- data/lib/picolena/templates/lang/ui/es.yml +1 -1
- data/lib/picolena/templates/lib/core_exts.rb +7 -7
- data/lib/picolena/templates/lib/plain_text_extractor_DSL.rb +10 -10
- data/lib/picolena/templates/lib/plain_text_extractors/ms.excel.rb +1 -1
- data/lib/picolena/templates/lib/plain_text_extractors/plain_text.rb +2 -2
- data/lib/picolena/templates/lib/tasks/index.rake +8 -3
- data/lib/picolena/templates/lib/tasks/install_dependencies.rake +2 -2
- data/lib/picolena/templates/lib/tasks/log.rake +1 -1
- data/lib/picolena/templates/public/.htaccess +3 -3
- data/lib/picolena/templates/public/images/flags/sv.png +0 -0
- data/lib/picolena/templates/public/stylesheets/style.css +2 -2
- data/lib/picolena/templates/script/spec_server +1 -1
- data/lib/picolena/templates/spec/controllers/application_controller_spec.rb +2 -2
- data/lib/picolena/templates/spec/controllers/documents_controller_spec.rb +17 -17
- data/lib/picolena/templates/spec/helpers/application_helper_spec.rb +2 -2
- data/lib/picolena/templates/spec/helpers/documents_helper_spec.rb +3 -3
- data/lib/picolena/templates/spec/models/basic_finder_spec.rb +14 -14
- data/lib/picolena/templates/spec/models/document_spec.rb +7 -15
- data/lib/picolena/templates/spec/models/finder_spec.rb +45 -38
- data/lib/picolena/templates/spec/models/host_indexing_system_spec.rb +5 -5
- data/lib/picolena/templates/spec/models/index_directories_spec.rb +2 -2
- data/lib/picolena/templates/spec/models/plain_text_extractor_spec.rb +6 -6
- data/lib/picolena/templates/spec/models/query_spec.rb +7 -7
- data/lib/picolena/templates/spec/rcov.opts +1 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/basic/myfirstjavaprog.java +1 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/basic/queens.for +1 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/lang/hugo +74 -74
- data/lib/picolena/templates/spec/test_dirs/indexed/lang/lorca +56 -56
- data/lib/picolena/templates/spec/test_dirs/indexed/others/7.html +4 -4
- data/lib/picolena/templates/spec/test_dirs/indexed/others/ccmatrix1.cpp +6 -6
- data/lib/picolena/templates/spec/test_dirs/indexed/others/lemonde.htm +326 -326
- data/lib/picolena/templates/spec/test_dirs/indexed/others/nested/ReadMe.rtf +62 -62
- data/lib/picolena/templates/spec/test_dirs/indexed/others/xor.vee +0 -1
- data/lib/picolena/templates/spec/test_dirs/indexed/others/zafh.net.html +1 -1
- data/lib/picolena/version.rb +1 -1
- data/lib/rubigen_ext.rb +1 -1
- data/rails_plugins/globalite/CHANGELOG +1 -1
- data/rails_plugins/globalite/README +19 -19
- data/rails_plugins/globalite/lang/rails/de-DE.yml +6 -6
- data/rails_plugins/globalite/lang/rails/en-UK.yml +10 -10
- data/rails_plugins/globalite/lang/rails/en-US.yml +10 -10
- data/rails_plugins/globalite/lang/rails/es-ES.yml +11 -11
- data/rails_plugins/globalite/lang/rails/fr-FR.yml +10 -10
- data/rails_plugins/globalite/lang/rails/it.yml +10 -10
- data/rails_plugins/globalite/lang/rails/pt-BR.yml +6 -6
- data/rails_plugins/globalite/lang/rails/pt-PT.yml +6 -6
- data/rails_plugins/globalite/lib/globalite/l10n.rb +25 -25
- data/rails_plugins/globalite/lib/globalite/locale.rb +9 -9
- data/rails_plugins/globalite/lib/rails/core_ext.rb +4 -4
- data/rails_plugins/globalite/lib/rails/localization.rb +3 -3
- data/rails_plugins/globalite/lib/rails/localized_action_view.rb +17 -17
- data/rails_plugins/globalite/lib/rails/localized_active_record.rb +4 -4
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/DateHelper.html +19 -19
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/FormOptionsHelper.html +9 -9
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers/NumberHelper.html +8 -8
- data/rails_plugins/globalite/rdoc/classes/ActionView/Helpers.html +5 -5
- data/rails_plugins/globalite/rdoc/classes/ActionView.html +5 -5
- data/rails_plugins/globalite/rdoc/classes/ActiveRecord/Errors.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/ActiveRecord.html +5 -5
- data/rails_plugins/globalite/rdoc/classes/Array.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/Date.html +8 -8
- data/rails_plugins/globalite/rdoc/classes/Globalite/L10n.html +49 -49
- data/rails_plugins/globalite/rdoc/classes/Globalite.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/Kernel.html +6 -6
- data/rails_plugins/globalite/rdoc/classes/Locale.html +11 -11
- data/rails_plugins/globalite/rdoc/classes/Time.html +8 -8
- data/rails_plugins/globalite/rdoc/files/README.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/globalite/l10n_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/globalite/locale_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/globalite_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/core_ext_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/localization_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/localized_action_view_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/files/lib/rails/localized_active_record_rb.html +5 -5
- data/rails_plugins/globalite/rdoc/fr_class_index.html +1 -1
- data/rails_plugins/globalite/rdoc/fr_file_index.html +1 -1
- data/rails_plugins/globalite/rdoc/fr_method_index.html +1 -1
- data/rails_plugins/globalite/rdoc/index.html +1 -1
- data/rails_plugins/globalite/spec/core_localization_spec.rb +18 -18
- data/rails_plugins/globalite/spec/l10n_spec.rb +25 -25
- data/rails_plugins/globalite/tasks/globalite_tasks.rake +6 -6
- data/rails_plugins/rspec/CHANGES +16 -16
- data/rails_plugins/rspec/README +2 -2
- data/rails_plugins/rspec/Rakefile +1 -1
- data/rails_plugins/rspec/UPGRADE +1 -1
- data/rails_plugins/rspec/autotest/discover.rb +1 -1
- data/rails_plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +5 -5
- data/rails_plugins/rspec/examples/pure/before_and_after_example.rb +2 -2
- data/rails_plugins/rspec/examples/pure/behave_as_example.rb +5 -5
- data/rails_plugins/rspec/examples/pure/custom_expectation_matchers.rb +7 -7
- data/rails_plugins/rspec/examples/pure/file_accessor.rb +1 -1
- data/rails_plugins/rspec/examples/pure/file_accessor_spec.rb +2 -2
- data/rails_plugins/rspec/examples/pure/helper_method_example.rb +1 -1
- data/rails_plugins/rspec/examples/pure/legacy_spec.rb +2 -2
- data/rails_plugins/rspec/examples/pure/predicate_example.rb +2 -2
- data/rails_plugins/rspec/examples/pure/shared_example_group_example.rb +11 -11
- data/rails_plugins/rspec/examples/pure/shared_stack_examples.rb +4 -4
- data/rails_plugins/rspec/examples/pure/stack.rb +6 -6
- data/rails_plugins/rspec/examples/pure/stack_spec.rb +7 -7
- data/rails_plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +10 -10
- data/rails_plugins/rspec/examples/pure/stubbing_example.rb +4 -4
- data/rails_plugins/rspec/examples/stories/adder.rb +2 -2
- data/rails_plugins/rspec/examples/stories/addition +8 -8
- data/rails_plugins/rspec/examples/stories/calculator.rb +5 -5
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +7 -7
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +13 -13
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +5 -5
- data/rails_plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +2 -2
- data/rails_plugins/rspec/examples/stories/game-of-life/life/game.rb +3 -3
- data/rails_plugins/rspec/examples/stories/game-of-life/life/grid.rb +10 -10
- data/rails_plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +5 -5
- data/rails_plugins/rspec/failing_examples/failure_in_setup.rb +3 -3
- data/rails_plugins/rspec/failing_examples/failure_in_teardown.rb +3 -3
- data/rails_plugins/rspec/failing_examples/mocking_example.rb +1 -1
- data/rails_plugins/rspec/failing_examples/raising_example.rb +11 -11
- data/rails_plugins/rspec/failing_examples/team_spec.rb +5 -5
- data/rails_plugins/rspec/lib/autotest/rspec.rb +5 -5
- data/rails_plugins/rspec/lib/spec/example/configuration.rb +4 -4
- data/rails_plugins/rspec/lib/spec/example/example_group_factory.rb +3 -3
- data/rails_plugins/rspec/lib/spec/example/example_group_methods.rb +1 -1
- data/rails_plugins/rspec/lib/spec/example/example_matcher.rb +2 -2
- data/rails_plugins/rspec/lib/spec/example/example_methods.rb +4 -4
- data/rails_plugins/rspec/lib/spec/example/pending.rb +1 -1
- data/rails_plugins/rspec/lib/spec/expectations/differs/default.rb +5 -5
- data/rails_plugins/rspec/lib/spec/expectations/errors.rb +1 -1
- data/rails_plugins/rspec/lib/spec/expectations/handler.rb +5 -5
- data/rails_plugins/rspec/lib/spec/expectations.rb +1 -1
- data/rails_plugins/rspec/lib/spec/extensions/main.rb +8 -8
- data/rails_plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +2 -2
- data/rails_plugins/rspec/lib/spec/matchers/be.rb +18 -18
- data/rails_plugins/rspec/lib/spec/matchers/be_close.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/change.rb +20 -20
- data/rails_plugins/rspec/lib/spec/matchers/eql.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/equal.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/has.rb +8 -8
- data/rails_plugins/rspec/lib/spec/matchers/have.rb +9 -9
- data/rails_plugins/rspec/lib/spec/matchers/include.rb +7 -7
- data/rails_plugins/rspec/lib/spec/matchers/match.rb +6 -6
- data/rails_plugins/rspec/lib/spec/matchers/operator_matcher.rb +1 -1
- data/rails_plugins/rspec/lib/spec/matchers/raise_error.rb +6 -6
- data/rails_plugins/rspec/lib/spec/matchers/respond_to.rb +7 -7
- data/rails_plugins/rspec/lib/spec/matchers/satisfy.rb +4 -4
- data/rails_plugins/rspec/lib/spec/matchers/simple_matcher.rb +3 -3
- data/rails_plugins/rspec/lib/spec/matchers/throw_symbol.rb +8 -8
- data/rails_plugins/rspec/lib/spec/matchers.rb +2 -2
- data/rails_plugins/rspec/lib/spec/mocks/argument_constraint_matchers.rb +3 -3
- data/rails_plugins/rspec/lib/spec/mocks/argument_expectation.rb +32 -32
- data/rails_plugins/rspec/lib/spec/mocks/error_generator.rb +13 -13
- data/rails_plugins/rspec/lib/spec/mocks/errors.rb +1 -1
- data/rails_plugins/rspec/lib/spec/mocks/message_expectation.rb +38 -38
- data/rails_plugins/rspec/lib/spec/mocks/methods.rb +3 -3
- data/rails_plugins/rspec/lib/spec/mocks/mock.rb +5 -5
- data/rails_plugins/rspec/lib/spec/mocks/order_group.rb +5 -5
- data/rails_plugins/rspec/lib/spec/mocks/proxy.rb +4 -4
- data/rails_plugins/rspec/lib/spec/mocks/space.rb +3 -3
- data/rails_plugins/rspec/lib/spec/mocks/spec_methods.rb +1 -1
- data/rails_plugins/rspec/lib/spec/mocks.rb +13 -13
- data/rails_plugins/rspec/lib/spec/rake/spectask.rb +4 -4
- data/rails_plugins/rspec/lib/spec/rake/verify_rcov.rb +9 -9
- data/rails_plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +2 -2
- data/rails_plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +7 -7
- data/rails_plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +13 -13
- data/rails_plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +1 -1
- data/rails_plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +8 -8
- data/rails_plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +7 -7
- data/rails_plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +2 -2
- data/rails_plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +5 -5
- data/rails_plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +4 -4
- data/rails_plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +6 -6
- data/rails_plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +12 -12
- data/rails_plugins/rspec/lib/spec/runner/heckle_runner.rb +6 -6
- data/rails_plugins/rspec/lib/spec/runner/option_parser.rb +5 -5
- data/rails_plugins/rspec/lib/spec/runner/options.rb +8 -8
- data/rails_plugins/rspec/lib/spec/runner/reporter.rb +14 -14
- data/rails_plugins/rspec/lib/spec/runner.rb +41 -41
- data/rails_plugins/rspec/lib/spec/story/extensions/main.rb +6 -6
- data/rails_plugins/rspec/lib/spec/story/extensions/regexp.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/extensions/string.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/given_scenario.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +6 -6
- data/rails_plugins/rspec/lib/spec/story/runner/scenario_collector.rb +2 -2
- data/rails_plugins/rspec/lib/spec/story/runner/scenario_runner.rb +5 -5
- data/rails_plugins/rspec/lib/spec/story/runner/story_mediator.rb +20 -20
- data/rails_plugins/rspec/lib/spec/story/runner/story_parser.rb +29 -29
- data/rails_plugins/rspec/lib/spec/story/runner/story_runner.rb +8 -8
- data/rails_plugins/rspec/lib/spec/story/runner.rb +7 -7
- data/rails_plugins/rspec/lib/spec/story/scenario.rb +1 -1
- data/rails_plugins/rspec/lib/spec/story/step.rb +5 -5
- data/rails_plugins/rspec/lib/spec/story/step_group.rb +12 -12
- data/rails_plugins/rspec/lib/spec/story/step_mother.rb +6 -6
- data/rails_plugins/rspec/lib/spec/story/story.rb +5 -5
- data/rails_plugins/rspec/lib/spec/story/world.rb +16 -16
- data/rails_plugins/rspec/lib/spec/translator.rb +21 -21
- data/rails_plugins/rspec/lib/spec/version.rb +2 -2
- data/rails_plugins/rspec/lib/spec.rb +1 -1
- data/rails_plugins/rspec/pre_commit/lib/pre_commit/pre_commit.rb +1 -1
- data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec.rb +6 -6
- data/rails_plugins/rspec/pre_commit/lib/pre_commit/rspec_on_rails.rb +6 -6
- data/rails_plugins/rspec/pre_commit/spec/pre_commit/pre_commit_spec.rb +1 -1
- data/rails_plugins/rspec/pre_commit/spec/pre_commit/rspec_on_rails_spec.rb +1 -1
- data/rails_plugins/rspec/report.html +3 -3
- data/rails_plugins/rspec/spec/autotest/discover_spec.rb +2 -2
- data/rails_plugins/rspec/spec/autotest/rspec_spec.rb +30 -30
- data/rails_plugins/rspec/spec/autotest_matchers.rb +7 -7
- data/rails_plugins/rspec/spec/spec/example/configuration_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/example/example_group_factory_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/example/example_group_methods_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/example/example_group_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/example/example_matcher_spec.rb +10 -10
- data/rails_plugins/rspec/spec/spec/example/example_runner_spec.rb +29 -29
- data/rails_plugins/rspec/spec/spec/example/example_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/example/nested_example_group_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/example/pending_module_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/example/shared_example_group_spec.rb +4 -4
- data/rails_plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/expectations/fail_with_spec.rb +8 -8
- data/rails_plugins/rspec/spec/spec/extensions/main_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
- data/rails_plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/matchers/be_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/matchers/change_spec.rb +14 -14
- data/rails_plugins/rspec/spec/spec/matchers/description_generation_spec.rb +25 -25
- data/rails_plugins/rspec/spec/spec/matchers/exist_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/matchers/handler_spec.rb +16 -16
- data/rails_plugins/rspec/spec/spec/matchers/have_spec.rb +13 -13
- data/rails_plugins/rspec/spec/spec/matchers/match_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +17 -17
- data/rails_plugins/rspec/spec/spec/matchers/raise_error_spec.rb +20 -20
- data/rails_plugins/rspec/spec/spec/matchers/respond_to_spec.rb +10 -10
- data/rails_plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_10263.rb +3 -3
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +4 -4
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/mocks/mock_space_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/mock_spec.rb +56 -56
- data/rails_plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/mocks/once_counts_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/options_hash_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +16 -16
- data/rails_plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +10 -10
- data/rails_plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +13 -13
- data/rails_plugins/rspec/spec/spec/mocks/stub_spec.rb +7 -7
- data/rails_plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/package/bin_spec_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/command_line_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +2 -2
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +3 -3
- data/rails_plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +9 -9
- data/rails_plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +4 -4
- data/rails_plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +5 -5
- data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +13 -13
- data/rails_plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +2 -2
- data/rails_plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/runner/option_parser_spec.rb +9 -9
- data/rails_plugins/rspec/spec/spec/runner/options_spec.rb +13 -13
- data/rails_plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +1 -1
- data/rails_plugins/rspec/spec/spec/spec_classes.rb +8 -8
- data/rails_plugins/rspec/spec/spec/story/builders.rb +7 -7
- data/rails_plugins/rspec/spec/spec/story/extensions/main_spec.rb +6 -6
- data/rails_plugins/rspec/spec/spec/story/given_scenario_spec.rb +3 -3
- data/rails_plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +21 -21
- data/rails_plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +22 -22
- data/rails_plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +55 -55
- data/rails_plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +44 -44
- data/rails_plugins/rspec/spec/spec/story/runner_spec.rb +18 -18
- data/rails_plugins/rspec/spec/spec/story/scenario_spec.rb +2 -2
- data/rails_plugins/rspec/spec/spec/story/step_group_spec.rb +20 -20
- data/rails_plugins/rspec/spec/spec/story/step_mother_spec.rb +14 -14
- data/rails_plugins/rspec/spec/spec/story/step_spec.rb +33 -33
- data/rails_plugins/rspec/spec/spec/story/story_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec/translator_spec.rb +12 -12
- data/rails_plugins/rspec/spec/spec_helper.rb +5 -5
- data/rails_plugins/rspec/stories/resources/helpers/story_helper.rb +1 -1
- data/rails_plugins/rspec/stories/resources/steps/running_rspec.rb +4 -4
- data/rails_plugins/rspec/stories/resources/test/spec_and_test_together.rb +2 -2
- data/rails_plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +1 -1
- data/rails_plugins/rspec/story_server/prototype/javascripts/builder.js +14 -14
- data/rails_plugins/rspec/story_server/prototype/javascripts/controls.js +61 -61
- data/rails_plugins/rspec/story_server/prototype/javascripts/dragdrop.js +144 -144
- data/rails_plugins/rspec/story_server/prototype/javascripts/effects.js +127 -127
- data/rails_plugins/rspec/story_server/prototype/javascripts/rspec.js +15 -15
- data/rails_plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +7 -7
- data/rails_plugins/rspec/story_server/prototype/javascripts/slider.js +37 -37
- data/rails_plugins/rspec/story_server/prototype/javascripts/sound.js +4 -4
- data/rails_plugins/rspec/story_server/prototype/javascripts/unittest.js +66 -66
- data/rails_plugins/rspec/story_server/prototype/stories.html +9 -9
- data/rails_plugins/rspec_on_rails/MIT-LICENSE +11 -11
- data/rails_plugins/rspec_on_rails/generators/rspec/templates/rcov.opts +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec/templates/script/spec_server +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_controller/USAGE +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/helper_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_controller/templates/view_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +12 -12
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/controller_spec.rb +35 -35
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/helper_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/index_erb_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/new_erb_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/routing_spec.rb +11 -11
- data/rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/autotest/rails_rspec.rb +3 -3
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb +4 -4
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/rails_example_group.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/render_observer.rb +4 -4
- data/rails_plugins/rspec_on_rails/lib/spec/rails/example/view_example_group.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/action_controller/base.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/extensions/spec/matchers/have.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/assert_select.rb +10 -10
- data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb +6 -6
- data/rails_plugins/rspec_on_rails/lib/spec/rails/matchers/render_template.rb +7 -7
- data/rails_plugins/rspec_on_rails/lib/spec/rails/story_adapter.rb +1 -1
- data/rails_plugins/rspec_on_rails/lib/spec/rails.rb +8 -8
- data/rails_plugins/rspec_on_rails/spec/rails/autotest/mappings_spec.rb +6 -6
- data/rails_plugins/rspec_on_rails/spec/rails/example/controller_isolation_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/example/controller_spec_spec.rb +22 -22
- data/rails_plugins/rspec_on_rails/spec/rails/example/helper_spec_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/example/ivar_proxy_spec.rb +3 -3
- data/rails_plugins/rspec_on_rails/spec/rails/example/shared_behaviour_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/spec/rails/example/view_spec_spec.rb +8 -8
- data/rails_plugins/rspec_on_rails/spec/rails/extensions/action_view_base_spec.rb +7 -7
- data/rails_plugins/rspec_on_rails/spec/rails/extensions/active_record_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/assert_select_spec.rb +37 -37
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/description_generation_spec.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/have_text_spec.rb +4 -4
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/redirect_to_spec.rb +26 -26
- data/rails_plugins/rspec_on_rails/spec/rails/matchers/render_spec.rb +18 -18
- data/rails_plugins/rspec_on_rails/spec/rails/mocks/mock_model_spec.rb +2 -2
- data/rails_plugins/rspec_on_rails/spec/spec_helper.rb +1 -1
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/controller_spec_controller.rb +9 -9
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/redirect_spec_controller.rb +7 -7
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/render_spec_controller.rb +5 -5
- data/rails_plugins/rspec_on_rails/spec_resources/controllers/rjs_spec_controller.rb +10 -10
- data/rails_plugins/rspec_on_rails/spec_resources/helpers/explicit_helper.rb +1 -1
- data/rails_plugins/rspec_on_rails/stories/transactions_should_rollback.rb +1 -1
- data/rails_plugins/rspec_on_rails/tasks/rspec.rake +4 -4
- data/script/txt2html +1 -1
- data/setup.rb +4 -4
- data/tasks/hack.rake +3 -3
- data/website/index.html +2 -2
- data/website/index.txt +1 -1
- data/website/index_devjavu +3 -3
- data/website/javascripts/rounded_corners_lite.inc.js +1 -1
- data/website/stylesheets/screen.css +2 -2
- data.tar.gz.sig +0 -0
- metadata +2 -1
- metadata.gz.sig +2 -1
@@ -54,7 +54,7 @@ describe "should change { block }" do
|
|
54
54
|
lambda {}.should change{ @instance.some_value }
|
55
55
|
end.should fail_with("result should have changed, but is still 5")
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
it "should warn if passed a block using do/end" do
|
59
59
|
lambda do
|
60
60
|
lambda {}.should change do
|
@@ -78,7 +78,7 @@ describe "should_not change { block }" do
|
|
78
78
|
lambda {@instance.some_value = 6}.should_not change { @instance.some_value }
|
79
79
|
end.should fail_with("result should not have changed, but did change from 5 to 6")
|
80
80
|
end
|
81
|
-
|
81
|
+
|
82
82
|
it "should warn if passed a block using do/end" do
|
83
83
|
lambda do
|
84
84
|
lambda {}.should_not change do
|
@@ -142,10 +142,10 @@ describe "should change(actual, message).by_at_least(expected)" do
|
|
142
142
|
it "should pass when attribute is changed by greater than the expected amount" do
|
143
143
|
lambda { @instance.some_value += 2 }.should change(@instance, :some_value).by_at_least(1)
|
144
144
|
end
|
145
|
-
|
145
|
+
|
146
146
|
it "should pass when attribute is changed by the expected amount" do
|
147
147
|
lambda { @instance.some_value += 2 }.should change(@instance, :some_value).by_at_least(2)
|
148
|
-
end
|
148
|
+
end
|
149
149
|
|
150
150
|
it "should fail when the attribute is changed by less than the expected amount" do
|
151
151
|
lambda do
|
@@ -164,10 +164,10 @@ describe "should change{ block }.by_at_least(expected)" do
|
|
164
164
|
it "should pass when attribute is changed by greater than expected amount" do
|
165
165
|
lambda { @instance.some_value += 2 }.should change{@instance.some_value}.by_at_least(1)
|
166
166
|
end
|
167
|
-
|
167
|
+
|
168
168
|
it "should pass when attribute is changed by the expected amount" do
|
169
169
|
lambda { @instance.some_value += 2 }.should change{@instance.some_value}.by_at_least(2)
|
170
|
-
end
|
170
|
+
end
|
171
171
|
|
172
172
|
it "should fail when the attribute is changed by less than the unexpected amount" do
|
173
173
|
lambda do
|
@@ -186,10 +186,10 @@ describe "should change(actual, message).by_at_most(expected)" do
|
|
186
186
|
it "should pass when attribute is changed by less than the expected amount" do
|
187
187
|
lambda { @instance.some_value += 2 }.should change(@instance, :some_value).by_at_most(3)
|
188
188
|
end
|
189
|
-
|
189
|
+
|
190
190
|
it "should pass when attribute is changed by the expected amount" do
|
191
191
|
lambda { @instance.some_value += 2 }.should change(@instance, :some_value).by_at_most(2)
|
192
|
-
end
|
192
|
+
end
|
193
193
|
|
194
194
|
it "should fail when the attribute is changed by greater than the expected amount" do
|
195
195
|
lambda do
|
@@ -208,10 +208,10 @@ describe "should change{ block }.by_at_most(expected)" do
|
|
208
208
|
it "should pass when attribute is changed by less than expected amount" do
|
209
209
|
lambda { @instance.some_value += 2 }.should change{@instance.some_value}.by_at_most(3)
|
210
210
|
end
|
211
|
-
|
211
|
+
|
212
212
|
it "should pass when attribute is changed by the expected amount" do
|
213
213
|
lambda { @instance.some_value += 2 }.should change{@instance.some_value}.by_at_most(2)
|
214
|
-
end
|
214
|
+
end
|
215
215
|
|
216
216
|
it "should fail when the attribute is changed by greater than the unexpected amount" do
|
217
217
|
lambda do
|
@@ -259,7 +259,7 @@ describe "should change(actual, message).to(new)" do
|
|
259
259
|
@instance = SomethingExpected.new
|
260
260
|
@instance.some_value = 'string'
|
261
261
|
end
|
262
|
-
|
262
|
+
|
263
263
|
it "should pass when attribute is == to expected value after executing block" do
|
264
264
|
lambda { @instance.some_value = "cat" }.should change(@instance, :some_value).to("cat")
|
265
265
|
end
|
@@ -276,7 +276,7 @@ describe "should change{ block }.to(new)" do
|
|
276
276
|
@instance = SomethingExpected.new
|
277
277
|
@instance.some_value = 'string'
|
278
278
|
end
|
279
|
-
|
279
|
+
|
280
280
|
it "should pass when attribute is == to expected value after executing block" do
|
281
281
|
lambda { @instance.some_value = "cat" }.should change{@instance.some_value}.to("cat")
|
282
282
|
end
|
@@ -293,7 +293,7 @@ describe "should change(actual, message).from(old).to(new)" do
|
|
293
293
|
@instance = SomethingExpected.new
|
294
294
|
@instance.some_value = 'string'
|
295
295
|
end
|
296
|
-
|
296
|
+
|
297
297
|
it "should pass when #to comes before #from" do
|
298
298
|
lambda { @instance.some_value = "cat" }.should change(@instance, :some_value).to("cat").from("string")
|
299
299
|
end
|
@@ -308,7 +308,7 @@ describe "should change{ block }.from(old).to(new)" do
|
|
308
308
|
@instance = SomethingExpected.new
|
309
309
|
@instance.some_value = 'string'
|
310
310
|
end
|
311
|
-
|
311
|
+
|
312
312
|
it "should pass when #to comes before #from" do
|
313
313
|
lambda { @instance.some_value = "cat" }.should change{@instance.some_value}.to("cat").from("string")
|
314
314
|
end
|
@@ -9,42 +9,42 @@ describe "Matchers should be able to generate their own descriptions" do
|
|
9
9
|
"this".should == "this"
|
10
10
|
Spec::Matchers.generated_description.should == "should == \"this\""
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
it "should not == expected" do
|
14
14
|
"this".should_not == "that"
|
15
15
|
Spec::Matchers.generated_description.should == "should not == \"that\""
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
it "should be empty (arbitrary predicate)" do
|
19
19
|
[].should be_empty
|
20
20
|
Spec::Matchers.generated_description.should == "should be empty"
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
it "should not be empty (arbitrary predicate)" do
|
24
24
|
[1].should_not be_empty
|
25
25
|
Spec::Matchers.generated_description.should == "should not be empty"
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
it "should be true" do
|
29
29
|
true.should be_true
|
30
30
|
Spec::Matchers.generated_description.should == "should be true"
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
it "should be false" do
|
34
34
|
false.should be_false
|
35
35
|
Spec::Matchers.generated_description.should == "should be false"
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
it "should be nil" do
|
39
39
|
nil.should be_nil
|
40
40
|
Spec::Matchers.generated_description.should == "should be nil"
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
it "should be > n" do
|
44
44
|
5.should be > 3
|
45
45
|
Spec::Matchers.generated_description.should == "should be > 3"
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
it "should be predicate arg1, arg2 and arg3" do
|
49
49
|
5.0.should be_between(0,10)
|
50
50
|
Spec::Matchers.generated_description.should == "should be between 0 and 10"
|
@@ -61,88 +61,88 @@ describe "Matchers should be able to generate their own descriptions" do
|
|
61
61
|
5.should be_an_instance_of(Fixnum)
|
62
62
|
Spec::Matchers.generated_description.should == "should be an instance of Fixnum"
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
it "should equal" do
|
66
66
|
expected = "expected"
|
67
67
|
expected.should equal(expected)
|
68
68
|
Spec::Matchers.generated_description.should == "should equal \"expected\""
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
it "should_not equal" do
|
72
72
|
5.should_not equal(37)
|
73
73
|
Spec::Matchers.generated_description.should == "should not equal 37"
|
74
74
|
end
|
75
|
-
|
75
|
+
|
76
76
|
it "should eql" do
|
77
77
|
"string".should eql("string")
|
78
78
|
Spec::Matchers.generated_description.should == "should eql \"string\""
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
it "should not eql" do
|
82
82
|
"a".should_not eql(:a)
|
83
83
|
Spec::Matchers.generated_description.should == "should not eql :a"
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
it "should have_key" do
|
87
87
|
{:a => "a"}.should have_key(:a)
|
88
88
|
Spec::Matchers.generated_description.should == "should have key :a"
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
it "should have n items" do
|
92
92
|
team.should have(3).players
|
93
93
|
Spec::Matchers.generated_description.should == "should have 3 players"
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
it "should have at least n items" do
|
97
97
|
team.should have_at_least(2).players
|
98
98
|
Spec::Matchers.generated_description.should == "should have at least 2 players"
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
it "should have at most n items" do
|
102
102
|
team.should have_at_most(4).players
|
103
103
|
Spec::Matchers.generated_description.should == "should have at most 4 players"
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
it "should include" do
|
107
107
|
[1,2,3].should include(3)
|
108
108
|
Spec::Matchers.generated_description.should == "should include 3"
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
it "should match" do
|
112
112
|
"this string".should match(/this string/)
|
113
113
|
Spec::Matchers.generated_description.should == "should match /this string/"
|
114
114
|
end
|
115
|
-
|
115
|
+
|
116
116
|
it "should raise_error" do
|
117
117
|
lambda { raise }.should raise_error
|
118
118
|
Spec::Matchers.generated_description.should == "should raise Exception"
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
it "should raise_error with type" do
|
122
122
|
lambda { raise }.should raise_error(RuntimeError)
|
123
123
|
Spec::Matchers.generated_description.should == "should raise RuntimeError"
|
124
124
|
end
|
125
|
-
|
125
|
+
|
126
126
|
it "should raise_error with type and message" do
|
127
127
|
lambda { raise "there was an error" }.should raise_error(RuntimeError, "there was an error")
|
128
128
|
Spec::Matchers.generated_description.should == "should raise RuntimeError with \"there was an error\""
|
129
129
|
end
|
130
|
-
|
130
|
+
|
131
131
|
it "should respond_to" do
|
132
132
|
[].should respond_to(:insert)
|
133
133
|
Spec::Matchers.generated_description.should == "should respond to #insert"
|
134
134
|
end
|
135
|
-
|
135
|
+
|
136
136
|
it "should throw symbol" do
|
137
137
|
lambda { throw :what_a_mess }.should throw_symbol
|
138
138
|
Spec::Matchers.generated_description.should == "should throw a Symbol"
|
139
139
|
end
|
140
|
-
|
140
|
+
|
141
141
|
it "should throw symbol (with named symbol)" do
|
142
142
|
lambda { throw :what_a_mess }.should throw_symbol(:what_a_mess)
|
143
143
|
Spec::Matchers.generated_description.should == "should throw :what_a_mess"
|
144
144
|
end
|
145
|
-
|
145
|
+
|
146
146
|
def team
|
147
147
|
Class.new do
|
148
148
|
def players
|
@@ -12,7 +12,7 @@ class Substance
|
|
12
12
|
@description
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
class SubstanceTester
|
17
17
|
include Spec::Matchers
|
18
18
|
def initialize substance
|
@@ -24,22 +24,22 @@ class SubstanceTester
|
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "should exist," do
|
27
|
-
|
27
|
+
|
28
28
|
before(:each) do
|
29
29
|
@real = Substance.new true, 'something real'
|
30
30
|
@imaginary = Substance.new false, 'something imaginary'
|
31
31
|
end
|
32
32
|
|
33
33
|
describe "within an example group" do
|
34
|
-
|
34
|
+
|
35
35
|
it "should pass if target exists" do
|
36
36
|
@real.should exist
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
it "should fail if target does not exist" do
|
40
40
|
lambda { @imaginary.should exist }.should fail
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
it "should pass if target doesn't exist" do
|
44
44
|
lambda { @real.should_not exist }.should fail
|
45
45
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
2
|
|
3
3
|
module ExampleExpectations
|
4
|
-
|
4
|
+
|
5
5
|
class ArbitraryMatcher
|
6
6
|
def initialize(*args, &block)
|
7
7
|
if args.last.is_a? Hash
|
@@ -12,38 +12,38 @@ module ExampleExpectations
|
|
12
12
|
end
|
13
13
|
@block = block
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def matches?(target)
|
17
17
|
@target = target
|
18
18
|
return @expected == target
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def with(new_value)
|
22
22
|
@expected = new_value
|
23
23
|
self
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def failure_message
|
27
27
|
"expected #{@expected}, got #{@target}"
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
def negative_failure_message
|
31
31
|
"expected not #{@expected}, got #{@target}"
|
32
32
|
end
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
class PositiveOnlyMatcher < ArbitraryMatcher
|
36
36
|
undef negative_failure_message rescue nil
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def arbitrary_matcher(*args, &block)
|
40
40
|
ArbitraryMatcher.new(*args, &block)
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def positive_only_matcher(*args, &block)
|
44
44
|
PositiveOnlyMatcher.new(*args, &block)
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
end
|
48
48
|
|
49
49
|
module Spec
|
@@ -55,7 +55,7 @@ module Spec
|
|
55
55
|
matcher.should_receive(:matches?).with(actual).and_return(true)
|
56
56
|
ExpectationMatcherHandler.handle_matcher(actual, matcher)
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
it "should explain when the matcher parameter is not a matcher" do
|
60
60
|
begin
|
61
61
|
nonmatcher = mock("nonmatcher")
|
@@ -76,8 +76,8 @@ module Spec
|
|
76
76
|
lambda {
|
77
77
|
NegativeExpectationMatcherHandler.handle_matcher(actual, matcher)
|
78
78
|
}.should fail_with(/Matcher does not support should_not.\n/)
|
79
|
-
end
|
80
|
-
|
79
|
+
end
|
80
|
+
|
81
81
|
it "should ask the matcher if it matches" do
|
82
82
|
matcher = mock("matcher")
|
83
83
|
actual = Object.new
|
@@ -85,7 +85,7 @@ module Spec
|
|
85
85
|
matcher.should_receive(:matches?).with(actual).and_return(false)
|
86
86
|
NegativeExpectationMatcherHandler.handle_matcher(actual, matcher)
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
it "should explain when the matcher parameter is not a matcher" do
|
90
90
|
begin
|
91
91
|
nonmatcher = mock("nonmatcher")
|
@@ -97,10 +97,10 @@ module Spec
|
|
97
97
|
e.message.should =~ /^Expected a matcher, got /
|
98
98
|
end
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
describe ExpectationMatcherHandler do
|
102
102
|
include ExampleExpectations
|
103
|
-
|
103
|
+
|
104
104
|
it "should handle submitted args" do
|
105
105
|
5.should arbitrary_matcher(:expected => 5)
|
106
106
|
5.should arbitrary_matcher(:expected => "wrong").with(5)
|
@@ -117,7 +117,7 @@ module Spec
|
|
117
117
|
5.should arbitrary_matcher(:expected => 4) { 5 }
|
118
118
|
5.should arbitrary_matcher(:expected => 4).with(5) { 3 }
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
it "should explain when matcher does not support should_not" do
|
122
122
|
lambda {
|
123
123
|
5.should_not positive_only_matcher(:expected => 5)
|
@@ -35,7 +35,7 @@ describe "should have(n).items" do
|
|
35
35
|
owner.should have(4).items_in_collection_with_size_method
|
36
36
|
}.should fail_with("expected 4 items_in_collection_with_size_method, got 3")
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
it "should fail if target has a collection of items with > n members" do
|
40
40
|
owner = create_collection_owner_with(3)
|
41
41
|
lambda {
|
@@ -49,7 +49,7 @@ end
|
|
49
49
|
|
50
50
|
describe 'should have(1).item when Inflector is defined' do
|
51
51
|
include HaveSpecHelper
|
52
|
-
|
52
|
+
|
53
53
|
before do
|
54
54
|
unless Object.const_defined?(:Inflector)
|
55
55
|
class Inflector
|
@@ -59,7 +59,7 @@ describe 'should have(1).item when Inflector is defined' do
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
it 'should pluralize the collection name' do
|
64
64
|
owner = create_collection_owner_with(1)
|
65
65
|
owner.should have(1).item
|
@@ -87,7 +87,7 @@ describe "should_not have(n).items" do
|
|
87
87
|
owner.should_not have(4).items_in_collection_with_length_method
|
88
88
|
owner.should_not have(4).items_in_collection_with_size_method
|
89
89
|
end
|
90
|
-
|
90
|
+
|
91
91
|
it "should pass if target has a collection of items with > n members" do
|
92
92
|
owner = create_collection_owner_with(3)
|
93
93
|
owner.should_not have(2).items_in_collection_with_length_method
|
@@ -129,7 +129,7 @@ describe "should have_exactly(n).items" do
|
|
129
129
|
owner.should have_exactly(4).items_in_collection_with_size_method
|
130
130
|
}.should fail_with("expected 4 items_in_collection_with_size_method, got 3")
|
131
131
|
end
|
132
|
-
|
132
|
+
|
133
133
|
it "should fail if target has a collection of items with > n members" do
|
134
134
|
owner = create_collection_owner_with(3)
|
135
135
|
lambda {
|
@@ -149,7 +149,7 @@ describe "should have_at_least(n).items" do
|
|
149
149
|
owner.should have_at_least(3).items_in_collection_with_length_method
|
150
150
|
owner.should have_at_least(3).items_in_collection_with_size_method
|
151
151
|
end
|
152
|
-
|
152
|
+
|
153
153
|
it "should pass if target has a collection of items with > n members" do
|
154
154
|
owner = create_collection_owner_with(3)
|
155
155
|
owner.should have_at_least(2).items_in_collection_with_length_method
|
@@ -165,17 +165,17 @@ describe "should have_at_least(n).items" do
|
|
165
165
|
owner.should have_at_least(4).items_in_collection_with_size_method
|
166
166
|
}.should fail_with("expected at least 4 items_in_collection_with_size_method, got 3")
|
167
167
|
end
|
168
|
-
|
168
|
+
|
169
169
|
it "should provide educational negative failure messages" do
|
170
170
|
#given
|
171
171
|
owner = create_collection_owner_with(3)
|
172
172
|
length_matcher = have_at_least(3).items_in_collection_with_length_method
|
173
173
|
size_matcher = have_at_least(3).items_in_collection_with_size_method
|
174
|
-
|
174
|
+
|
175
175
|
#when
|
176
176
|
length_matcher.matches?(owner)
|
177
177
|
size_matcher.matches?(owner)
|
178
|
-
|
178
|
+
|
179
179
|
#then
|
180
180
|
length_matcher.negative_failure_message.should == <<-EOF
|
181
181
|
Isn't life confusing enough?
|
@@ -213,7 +213,7 @@ describe "should have_at_most(n).items" do
|
|
213
213
|
owner.should have_at_most(2).items_in_collection_with_size_method
|
214
214
|
}.should fail_with("expected at most 2 items_in_collection_with_size_method, got 3")
|
215
215
|
end
|
216
|
-
|
216
|
+
|
217
217
|
it "should pass if target has a collection of items with < n members" do
|
218
218
|
owner = create_collection_owner_with(3)
|
219
219
|
owner.should have_at_most(4).items_in_collection_with_length_method
|
@@ -225,11 +225,11 @@ describe "should have_at_most(n).items" do
|
|
225
225
|
owner = create_collection_owner_with(3)
|
226
226
|
length_matcher = have_at_most(3).items_in_collection_with_length_method
|
227
227
|
size_matcher = have_at_most(3).items_in_collection_with_size_method
|
228
|
-
|
228
|
+
|
229
229
|
#when
|
230
230
|
length_matcher.matches?(owner)
|
231
231
|
size_matcher.matches?(owner)
|
232
|
-
|
232
|
+
|
233
233
|
#then
|
234
234
|
length_matcher.negative_failure_message.should == <<-EOF
|
235
235
|
Isn't life confusing enough?
|
@@ -238,7 +238,7 @@ Instead of having to figure out the meaning of this:
|
|
238
238
|
We recommend that you use this instead:
|
239
239
|
should have_at_least(4).items_in_collection_with_length_method
|
240
240
|
EOF
|
241
|
-
|
241
|
+
|
242
242
|
size_matcher.negative_failure_message.should == <<-EOF
|
243
243
|
Isn't life confusing enough?
|
244
244
|
Instead of having to figure out the meaning of this:
|
@@ -62,7 +62,7 @@ This module should provide the following methods, each of which returns a Matche
|
|
62
62
|
respond_to(:sym).should be_an_instance_of(RespondTo)
|
63
63
|
end
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
describe "Spec::Matchers#method_missing" do
|
67
67
|
it "should convert be_xyz to Be(:be_xyz)" do
|
68
68
|
Be.should_receive(:new).with(:be_whatever)
|
@@ -3,13 +3,13 @@ require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
|
3
3
|
require 'spec/expectations/differs/default'
|
4
4
|
|
5
5
|
describe "should ==" do
|
6
|
-
|
6
|
+
|
7
7
|
it "should delegate message to target" do
|
8
8
|
subject = "apple"
|
9
9
|
subject.should_receive(:==).with("apple").and_return(true)
|
10
10
|
subject.should == "apple"
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
it "should fail when target.==(actual) returns false" do
|
14
14
|
subject = "apple"
|
15
15
|
Spec::Expectations.should_receive(:fail_with).with(%[expected: "orange",\n got: "apple" (using ==)], "orange", "apple")
|
@@ -19,13 +19,13 @@ describe "should ==" do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "should_not ==" do
|
22
|
-
|
22
|
+
|
23
23
|
it "should delegate message to target" do
|
24
24
|
subject = "orange"
|
25
25
|
subject.should_receive(:==).with("apple").and_return(false)
|
26
26
|
subject.should_not == "apple"
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
it "should fail when target.==(actual) returns false" do
|
30
30
|
subject = "apple"
|
31
31
|
Spec::Expectations.should_receive(:fail_with).with(%[expected not: == "apple",\n got: "apple"], "apple", "apple")
|
@@ -35,30 +35,30 @@ describe "should_not ==" do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
describe "should ===" do
|
38
|
-
|
38
|
+
|
39
39
|
it "should delegate message to target" do
|
40
40
|
subject = "apple"
|
41
41
|
subject.should_receive(:===).with("apple").and_return(true)
|
42
42
|
subject.should === "apple"
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
it "should fail when target.===(actual) returns false" do
|
46
46
|
subject = "apple"
|
47
47
|
subject.should_receive(:===).with("orange").and_return(false)
|
48
48
|
Spec::Expectations.should_receive(:fail_with).with(%[expected: "orange",\n got: "apple" (using ===)], "orange", "apple")
|
49
49
|
subject.should === "orange"
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
end
|
53
53
|
|
54
54
|
describe "should_not ===" do
|
55
|
-
|
55
|
+
|
56
56
|
it "should delegate message to target" do
|
57
57
|
subject = "orange"
|
58
58
|
subject.should_receive(:===).with("apple").and_return(false)
|
59
59
|
subject.should_not === "apple"
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it "should fail when target.===(actual) returns false" do
|
63
63
|
subject = "apple"
|
64
64
|
subject.should_receive(:===).with("apple").and_return(true)
|
@@ -69,13 +69,13 @@ describe "should_not ===" do
|
|
69
69
|
end
|
70
70
|
|
71
71
|
describe "should =~" do
|
72
|
-
|
72
|
+
|
73
73
|
it "should delegate message to target" do
|
74
74
|
subject = "foo"
|
75
75
|
subject.should_receive(:=~).with(/oo/).and_return(true)
|
76
76
|
subject.should =~ /oo/
|
77
77
|
end
|
78
|
-
|
78
|
+
|
79
79
|
it "should fail when target.=~(actual) returns false" do
|
80
80
|
subject = "fu"
|
81
81
|
subject.should_receive(:=~).with(/oo/).and_return(false)
|
@@ -86,13 +86,13 @@ describe "should =~" do
|
|
86
86
|
end
|
87
87
|
|
88
88
|
describe "should_not =~" do
|
89
|
-
|
89
|
+
|
90
90
|
it "should delegate message to target" do
|
91
91
|
subject = "fu"
|
92
92
|
subject.should_receive(:=~).with(/oo/).and_return(false)
|
93
93
|
subject.should_not =~ /oo/
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
it "should fail when target.=~(actual) returns false" do
|
97
97
|
subject = "foo"
|
98
98
|
subject.should_receive(:=~).with(/oo/).and_return(true)
|
@@ -103,7 +103,7 @@ describe "should_not =~" do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
describe "should >" do
|
106
|
-
|
106
|
+
|
107
107
|
it "should pass if > passes" do
|
108
108
|
4.should > 3
|
109
109
|
end
|
@@ -116,7 +116,7 @@ describe "should >" do
|
|
116
116
|
end
|
117
117
|
|
118
118
|
describe "should >=" do
|
119
|
-
|
119
|
+
|
120
120
|
it "should pass if >= passes" do
|
121
121
|
4.should > 3
|
122
122
|
4.should >= 4
|
@@ -130,7 +130,7 @@ describe "should >=" do
|
|
130
130
|
end
|
131
131
|
|
132
132
|
describe "should <" do
|
133
|
-
|
133
|
+
|
134
134
|
it "should pass if < passes" do
|
135
135
|
4.should < 5
|
136
136
|
end
|
@@ -143,7 +143,7 @@ describe "should <" do
|
|
143
143
|
end
|
144
144
|
|
145
145
|
describe "should <=" do
|
146
|
-
|
146
|
+
|
147
147
|
it "should pass if <= passes" do
|
148
148
|
4.should <= 5
|
149
149
|
4.should <= 4
|