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
@@ -2,12 +2,12 @@ module Spec
|
|
2
2
|
module Mocks
|
3
3
|
class ErrorGenerator
|
4
4
|
attr_writer :opts
|
5
|
-
|
5
|
+
|
6
6
|
def initialize(target, name)
|
7
7
|
@target = target
|
8
8
|
@name = name
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def opts
|
12
12
|
@opts ||= {}
|
13
13
|
end
|
@@ -15,47 +15,47 @@ module Spec
|
|
15
15
|
def raise_unexpected_message_error(sym, *args)
|
16
16
|
__raise "#{intro} received unexpected message :#{sym}#{arg_message(*args)}"
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def raise_unexpected_message_args_error(expectation, *args)
|
20
20
|
expected_args = format_args(*expectation.expected_args)
|
21
21
|
actual_args = args.empty? ? "(no args)" : format_args(*args)
|
22
22
|
__raise "#{intro} expected #{expectation.sym.inspect} with #{expected_args} but received it with #{actual_args}"
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def raise_expectation_error(sym, expected_received_count, actual_received_count, *args)
|
26
26
|
__raise "#{intro} expected :#{sym}#{arg_message(*args)} #{count_message(expected_received_count)}, but received it #{count_message(actual_received_count)}"
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def raise_out_of_order_error(sym)
|
30
30
|
__raise "#{intro} received :#{sym} out of order"
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def raise_block_failed_error(sym, detail)
|
34
34
|
__raise "#{intro} received :#{sym} but passed block failed with: #{detail}"
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def raise_missing_block_error(args_to_yield)
|
38
38
|
__raise "#{intro} asked to yield |#{arg_list(*args_to_yield)}| but no block was passed"
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def raise_wrong_arity_error(args_to_yield, arity)
|
42
42
|
__raise "#{intro} yielded |#{arg_list(*args_to_yield)}| to block with arity of #{arity}"
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
private
|
46
46
|
def intro
|
47
47
|
@name ? "Mock '#{@name}'" : @target.inspect
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
def __raise(message)
|
51
51
|
message = opts[:message] unless opts[:message].nil?
|
52
52
|
Kernel::raise(Spec::Mocks::MockExpectationError, message)
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
def arg_message(*args)
|
56
56
|
" with " + format_args(*args)
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
def format_args(*args)
|
60
60
|
return "(no args)" if args.empty? || args == [:no_args]
|
61
61
|
return "(any args)" if args == [:any_args]
|
@@ -67,7 +67,7 @@ module Spec
|
|
67
67
|
arg.respond_to?(:description) ? arg.description : arg.inspect
|
68
68
|
end.join(", ")
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
def count_message(count)
|
72
72
|
return "at least #{pretty_print(count.abs)}" if count < 0
|
73
73
|
return pretty_print(count)
|
@@ -3,7 +3,7 @@ module Spec
|
|
3
3
|
|
4
4
|
class BaseExpectation
|
5
5
|
attr_reader :sym
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(error_generator, expectation_ordering, expected_from, sym, method_block, expected_received_count=1, opts={})
|
8
8
|
@error_generator = error_generator
|
9
9
|
@error_generator.opts = opts
|
@@ -22,7 +22,7 @@ module Spec
|
|
22
22
|
@at_most = nil
|
23
23
|
@args_to_yield = []
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def expected_args
|
27
27
|
@args_expectation.args
|
28
28
|
end
|
@@ -42,7 +42,7 @@ module Spec
|
|
42
42
|
# Ruby 1.9 - see where this is used below
|
43
43
|
@ignore_args = !block_given?
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
# :call-seq:
|
47
47
|
# and_raise()
|
48
48
|
# and_raise(Exception) #any exception class
|
@@ -57,27 +57,27 @@ module Spec
|
|
57
57
|
def and_raise(exception=Exception)
|
58
58
|
@exception_to_raise = exception
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
def and_throw(symbol)
|
62
62
|
@symbol_to_throw = symbol
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def and_yield(*args)
|
66
66
|
@args_to_yield << args
|
67
67
|
self
|
68
68
|
end
|
69
|
-
|
69
|
+
|
70
70
|
def matches(sym, args)
|
71
71
|
@sym == sym and @args_expectation.check_args(args)
|
72
72
|
end
|
73
|
-
|
73
|
+
|
74
74
|
def invoke(args, block)
|
75
75
|
@order_group.handle_order_constraint self
|
76
76
|
|
77
77
|
begin
|
78
78
|
Kernel::raise @exception_to_raise unless @exception_to_raise.nil?
|
79
79
|
Kernel::throw @symbol_to_throw unless @symbol_to_throw.nil?
|
80
|
-
|
80
|
+
|
81
81
|
if !@method_block.nil?
|
82
82
|
default_return_val = invoke_method_block(args)
|
83
83
|
elsif @args_to_yield.size > 0
|
@@ -85,7 +85,7 @@ module Spec
|
|
85
85
|
else
|
86
86
|
default_return_val = nil
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
if @consecutive
|
90
90
|
return invoke_consecutive_return_block(args, block)
|
91
91
|
elsif @return_block
|
@@ -97,7 +97,7 @@ module Spec
|
|
97
97
|
@actual_received_count += 1
|
98
98
|
end
|
99
99
|
end
|
100
|
-
|
100
|
+
|
101
101
|
protected
|
102
102
|
|
103
103
|
def invoke_method_block(args)
|
@@ -107,7 +107,7 @@ module Spec
|
|
107
107
|
@error_generator.raise_block_failed_error @sym, detail.message
|
108
108
|
end
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
def invoke_with_yield(block)
|
112
112
|
if block.nil?
|
113
113
|
@error_generator.raise_missing_block_error @args_to_yield
|
@@ -119,15 +119,15 @@ module Spec
|
|
119
119
|
block.call(*args_to_yield_this_time)
|
120
120
|
end
|
121
121
|
end
|
122
|
-
|
122
|
+
|
123
123
|
def invoke_consecutive_return_block(args, block)
|
124
124
|
args << block unless block.nil?
|
125
125
|
value = @return_block.call(*args)
|
126
|
-
|
126
|
+
|
127
127
|
index = [@actual_received_count, value.size-1].min
|
128
128
|
value[index]
|
129
129
|
end
|
130
|
-
|
130
|
+
|
131
131
|
def invoke_return_block(args, block)
|
132
132
|
args << block unless block.nil?
|
133
133
|
# Ruby 1.9 - when we set @return_block to return values
|
@@ -140,39 +140,39 @@ module Spec
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|
143
|
-
|
143
|
+
|
144
144
|
class MessageExpectation < BaseExpectation
|
145
|
-
|
145
|
+
|
146
146
|
def matches_name_but_not_args(sym, args)
|
147
147
|
@sym == sym and not @args_expectation.check_args(args)
|
148
148
|
end
|
149
|
-
|
150
|
-
def verify_messages_received
|
149
|
+
|
150
|
+
def verify_messages_received
|
151
151
|
return if ignoring_args? || matches_exact_count? ||
|
152
152
|
matches_at_least_count? || matches_at_most_count?
|
153
|
-
|
153
|
+
|
154
154
|
generate_error
|
155
155
|
rescue Spec::Mocks::MockExpectationError => error
|
156
156
|
error.backtrace.insert(0, @expected_from)
|
157
157
|
Kernel::raise error
|
158
158
|
end
|
159
|
-
|
159
|
+
|
160
160
|
def ignoring_args?
|
161
161
|
@expected_received_count == :any
|
162
162
|
end
|
163
|
-
|
163
|
+
|
164
164
|
def matches_at_least_count?
|
165
165
|
@at_least && @actual_received_count >= @expected_received_count
|
166
166
|
end
|
167
|
-
|
167
|
+
|
168
168
|
def matches_at_most_count?
|
169
169
|
@at_most && @actual_received_count <= @expected_received_count
|
170
170
|
end
|
171
|
-
|
171
|
+
|
172
172
|
def matches_exact_count?
|
173
173
|
@expected_received_count == @actual_received_count
|
174
174
|
end
|
175
|
-
|
175
|
+
|
176
176
|
def generate_error
|
177
177
|
@error_generator.raise_expectation_error(@sym, @expected_received_count, @actual_received_count, *@args_expectation.args)
|
178
178
|
end
|
@@ -182,17 +182,17 @@ module Spec
|
|
182
182
|
@args_expectation = ArgumentExpectation.new(args)
|
183
183
|
self
|
184
184
|
end
|
185
|
-
|
185
|
+
|
186
186
|
def exactly(n)
|
187
187
|
set_expected_received_count :exactly, n
|
188
188
|
self
|
189
189
|
end
|
190
|
-
|
190
|
+
|
191
191
|
def at_least(n)
|
192
192
|
set_expected_received_count :at_least, n
|
193
193
|
self
|
194
194
|
end
|
195
|
-
|
195
|
+
|
196
196
|
def at_most(n)
|
197
197
|
set_expected_received_count :at_most, n
|
198
198
|
self
|
@@ -202,41 +202,41 @@ module Spec
|
|
202
202
|
@method_block = block if block
|
203
203
|
self
|
204
204
|
end
|
205
|
-
|
205
|
+
|
206
206
|
def any_number_of_times(&block)
|
207
207
|
@method_block = block if block
|
208
208
|
@expected_received_count = :any
|
209
209
|
self
|
210
210
|
end
|
211
|
-
|
211
|
+
|
212
212
|
def never
|
213
213
|
@expected_received_count = 0
|
214
214
|
self
|
215
215
|
end
|
216
|
-
|
216
|
+
|
217
217
|
def once(&block)
|
218
218
|
@method_block = block if block
|
219
219
|
@expected_received_count = 1
|
220
220
|
self
|
221
221
|
end
|
222
|
-
|
222
|
+
|
223
223
|
def twice(&block)
|
224
224
|
@method_block = block if block
|
225
225
|
@expected_received_count = 2
|
226
226
|
self
|
227
227
|
end
|
228
|
-
|
228
|
+
|
229
229
|
def ordered(&block)
|
230
230
|
@method_block = block if block
|
231
231
|
@order_group.register(self)
|
232
232
|
@ordered = true
|
233
233
|
self
|
234
234
|
end
|
235
|
-
|
235
|
+
|
236
236
|
def negative_expectation_for?(sym)
|
237
237
|
return false
|
238
238
|
end
|
239
|
-
|
239
|
+
|
240
240
|
protected
|
241
241
|
def set_expected_received_count(relativity, n)
|
242
242
|
@at_least = (relativity == :at_least)
|
@@ -250,18 +250,18 @@ module Spec
|
|
250
250
|
2
|
251
251
|
end
|
252
252
|
end
|
253
|
-
|
253
|
+
|
254
254
|
end
|
255
|
-
|
255
|
+
|
256
256
|
class NegativeMessageExpectation < MessageExpectation
|
257
257
|
def initialize(message, expectation_ordering, expected_from, sym, method_block)
|
258
258
|
super(message, expectation_ordering, expected_from, sym, method_block, 0)
|
259
259
|
end
|
260
|
-
|
260
|
+
|
261
261
|
def negative_expectation_for?(sym)
|
262
262
|
return @sym == sym
|
263
263
|
end
|
264
264
|
end
|
265
|
-
|
265
|
+
|
266
266
|
end
|
267
267
|
end
|
@@ -8,15 +8,15 @@ module Spec
|
|
8
8
|
def should_not_receive(sym, &block)
|
9
9
|
__mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block)
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def stub!(sym, opts={})
|
13
13
|
__mock_proxy.add_stub(caller(1)[0], sym.to_sym, opts)
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
def received_message?(sym, *args, &block) #:nodoc:
|
17
17
|
__mock_proxy.received_message?(sym.to_sym, *args, &block)
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def rspec_verify #:nodoc:
|
21
21
|
__mock_proxy.verify
|
22
22
|
end
|
@@ -11,7 +11,7 @@ module Spec
|
|
11
11
|
@options = parse_options(stubs_and_options)
|
12
12
|
assign_stubs(stubs_and_options)
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
# This allows for comparing the mock to other objects that proxy
|
16
16
|
# such as ActiveRecords belongs_to proxy objects
|
17
17
|
# By making the other object run the comparison, we're sure the call gets delegated to the proxy target
|
@@ -29,17 +29,17 @@ module Spec
|
|
29
29
|
__mock_proxy.raise_unexpected_message_error sym, *args
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
def inspect
|
34
34
|
"#<#{self.class}:#{sprintf '0x%x', self.object_id} @name=#{@name.inspect}>"
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
private
|
38
|
-
|
38
|
+
|
39
39
|
def parse_options(options)
|
40
40
|
options.has_key?(:null_object) ? {:null_object => options.delete(:null_object)} : {}
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
def assign_stubs(stubs)
|
44
44
|
stubs.each_pair do |message, response|
|
45
45
|
stub!(message).and_return(response)
|
@@ -5,25 +5,25 @@ module Spec
|
|
5
5
|
@error_generator = error_generator
|
6
6
|
@ordering = Array.new
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def register(expectation)
|
10
10
|
@ordering << expectation
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
def ready_for?(expectation)
|
14
14
|
return @ordering.first == expectation
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
def consume
|
18
18
|
@ordering.shift
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def handle_order_constraint expectation
|
22
22
|
return unless @ordering.include? expectation
|
23
23
|
return consume if ready_for?(expectation)
|
24
24
|
@error_generator.raise_out_of_order_error expectation.sym
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -79,14 +79,14 @@ module Spec
|
|
79
79
|
def raise_unexpected_message_error(sym, *args)
|
80
80
|
@error_generator.raise_unexpected_message_error sym, *args
|
81
81
|
end
|
82
|
-
|
82
|
+
|
83
83
|
private
|
84
84
|
|
85
85
|
def __add(sym)
|
86
86
|
$rspec_mocks.add(@target) unless $rspec_mocks.nil?
|
87
87
|
define_expected_method(sym)
|
88
88
|
end
|
89
|
-
|
89
|
+
|
90
90
|
def define_expected_method(sym)
|
91
91
|
if target_responds_to?(sym) && !metaclass.method_defined?(munge(sym))
|
92
92
|
munged_sym = munge(sym)
|
@@ -95,7 +95,7 @@ module Spec
|
|
95
95
|
end
|
96
96
|
@proxied_methods << sym
|
97
97
|
end
|
98
|
-
|
98
|
+
|
99
99
|
metaclass_eval(<<-EOF, __FILE__, __LINE__)
|
100
100
|
def #{sym}(*args, &block)
|
101
101
|
__mock_proxy.message_received :#{sym}, *args, &block
|
@@ -128,7 +128,7 @@ module Spec
|
|
128
128
|
def metaclass_eval(str, filename, lineno)
|
129
129
|
metaclass.class_eval(str, filename, lineno)
|
130
130
|
end
|
131
|
-
|
131
|
+
|
132
132
|
def metaclass
|
133
133
|
(class << @target; self; end)
|
134
134
|
end
|
@@ -23,12 +23,12 @@ module Spec
|
|
23
23
|
# which can help clarify the role it is playing within a given spec.
|
24
24
|
#
|
25
25
|
# == Mock Objects
|
26
|
-
#
|
26
|
+
#
|
27
27
|
# Mocks are objects that allow you to set and verify expectations that they will
|
28
28
|
# receive specific messages during run time. They are very useful for specifying how the subject of
|
29
29
|
# the spec interacts with its collaborators. This approach is widely known as "interaction
|
30
30
|
# testing".
|
31
|
-
#
|
31
|
+
#
|
32
32
|
# Mocks are also very powerful as a design tool. As you are
|
33
33
|
# driving the implementation of a given class, Mocks provide an anonymous
|
34
34
|
# collaborator that can change in behaviour as quickly as you can write an expectation in your
|
@@ -36,12 +36,12 @@ module Spec
|
|
36
36
|
# does not yet exist. As the shape of the class being specified becomes more clear, so do the
|
37
37
|
# requirements for its collaborators - often leading to the discovery of new types that are
|
38
38
|
# needed in your system.
|
39
|
-
#
|
39
|
+
#
|
40
40
|
# Read Endo-Testing[http://www.mockobjects.com/files/endotesting.pdf] for a much
|
41
41
|
# more in depth description of this process.
|
42
|
-
#
|
42
|
+
#
|
43
43
|
# == Stubs
|
44
|
-
#
|
44
|
+
#
|
45
45
|
# Stubs are objects that allow you to set "stub" responses to
|
46
46
|
# messages. As Martin Fowler points out on his site,
|
47
47
|
# mocks_arent_stubs[http://www.martinfowler.com/articles/mocksArentStubs.html].
|
@@ -49,25 +49,25 @@ module Spec
|
|
49
49
|
# of Gerard Meszaros: Stubs provide canned responses to messages they might receive in a test, while
|
50
50
|
# mocks allow you to specify and, subsquently, verify that certain messages should be received during
|
51
51
|
# the execution of a test.
|
52
|
-
#
|
52
|
+
#
|
53
53
|
# == Partial Mocks/Stubs
|
54
|
-
#
|
54
|
+
#
|
55
55
|
# RSpec also supports partial mocking/stubbing, allowing you to add stub/mock behaviour
|
56
56
|
# to instances of your existing classes. This is generally
|
57
57
|
# something to be avoided, because changes to the class can have ripple effects on
|
58
58
|
# seemingly unrelated specs. When specs fail due to these ripple effects, the fact
|
59
59
|
# that some methods are being mocked can make it difficult to understand why a
|
60
60
|
# failure is occurring.
|
61
|
-
#
|
61
|
+
#
|
62
62
|
# That said, partials do allow you to expect and
|
63
63
|
# verify interactions with class methods such as +#find+ and +#create+
|
64
64
|
# on Ruby on Rails model classes.
|
65
|
-
#
|
65
|
+
#
|
66
66
|
# == Further Reading
|
67
|
-
#
|
67
|
+
#
|
68
68
|
# There are many different viewpoints about the meaning of mocks and stubs. If you are interested
|
69
69
|
# in learning more, here is some recommended reading:
|
70
|
-
#
|
70
|
+
#
|
71
71
|
# * Mock Objects: http://www.mockobjects.com/
|
72
72
|
# * Endo-Testing: http://www.mockobjects.com/files/endotesting.pdf
|
73
73
|
# * Mock Roles, Not Objects: http://www.mockobjects.com/files/mockrolesnotobjects.pdf
|
@@ -110,7 +110,7 @@ module Spec
|
|
110
110
|
#
|
111
111
|
# my_mock.should_receive(:sym)
|
112
112
|
# my_mock.should_not_receive(:sym)
|
113
|
-
#
|
113
|
+
#
|
114
114
|
# == Expecting Arguments
|
115
115
|
#
|
116
116
|
# my_mock.should_receive(:sym).with(*args)
|
@@ -137,7 +137,7 @@ module Spec
|
|
137
137
|
# my_mock.should_receive(:sym).with(1, anything(), "b") #2nd argument can be anything at all
|
138
138
|
# my_mock.should_receive(:sym).with(1, ducktype(:abs, :div), "b")
|
139
139
|
# #2nd argument can be object that responds to #abs and #div
|
140
|
-
#
|
140
|
+
#
|
141
141
|
# == Receive Counts
|
142
142
|
#
|
143
143
|
# my_mock.should_receive(:sym).once
|
@@ -11,7 +11,7 @@ module Spec
|
|
11
11
|
# A Rake task that runs a set of specs.
|
12
12
|
#
|
13
13
|
# Example:
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# Spec::Rake::SpecTask.new do |t|
|
16
16
|
# t.warning = true
|
17
17
|
# t.rcov = true
|
@@ -87,7 +87,7 @@ module Spec
|
|
87
87
|
# Whether or not to use RCov (default is false)
|
88
88
|
# See http://eigenclass.org/hiki.rb?rcov
|
89
89
|
attr_accessor :rcov
|
90
|
-
|
90
|
+
|
91
91
|
# Array of commandline options to pass to RCov. Defaults to ['--exclude', 'lib\/spec,bin\/spec'].
|
92
92
|
# Ignored if rcov=false
|
93
93
|
# Setting the RCOV_OPTS environment variable overrides this.
|
@@ -117,7 +117,7 @@ module Spec
|
|
117
117
|
# used, then the list of spec files is the union of the two.
|
118
118
|
# Setting the SPEC environment variable overrides this.
|
119
119
|
attr_accessor :spec_files
|
120
|
-
|
120
|
+
|
121
121
|
# Use verbose output. If this is set to true, the task will print
|
122
122
|
# the executed spec command to stdout. Defaults to false.
|
123
123
|
attr_accessor :verbose
|
@@ -210,7 +210,7 @@ module Spec
|
|
210
210
|
STDERR.puts "RSPECOPTS is DEPRECATED and will be removed in a future version. Use SPEC_OPTS instead." if ENV['RSPECOPTS']
|
211
211
|
ENV['SPEC_OPTS'] || ENV['RSPECOPTS'] || spec_opts.join(" ") || ""
|
212
212
|
end
|
213
|
-
|
213
|
+
|
214
214
|
def evaluate(o) # :nodoc:
|
215
215
|
case o
|
216
216
|
when Proc then o.call
|
@@ -5,23 +5,23 @@ module RCov
|
|
5
5
|
class VerifyTask < Rake::TaskLib
|
6
6
|
# Name of the task. Defaults to :verify_rcov
|
7
7
|
attr_accessor :name
|
8
|
-
|
8
|
+
|
9
9
|
# Path to the index.html file generated by RCov, which
|
10
10
|
# is the file containing the total coverage.
|
11
11
|
# Defaults to 'coverage/index.html'
|
12
12
|
attr_accessor :index_html
|
13
|
-
|
13
|
+
|
14
14
|
# Whether or not to output details. Defaults to true.
|
15
15
|
attr_accessor :verbose
|
16
|
-
|
17
|
-
# The threshold value (in percent) for coverage. If the
|
18
|
-
# actual coverage is not equal to this value, the task will raise an
|
19
|
-
# exception.
|
16
|
+
|
17
|
+
# The threshold value (in percent) for coverage. If the
|
18
|
+
# actual coverage is not equal to this value, the task will raise an
|
19
|
+
# exception.
|
20
20
|
attr_accessor :threshold
|
21
|
-
|
21
|
+
|
22
22
|
# Require the threshold value be met exactly. This is the default.
|
23
23
|
attr_accessor :require_exact_threshold
|
24
|
-
|
24
|
+
|
25
25
|
def initialize(name=:verify_rcov)
|
26
26
|
@name = name
|
27
27
|
@index_html = 'coverage/index.html'
|
@@ -31,7 +31,7 @@ module RCov
|
|
31
31
|
raise "Threshold must be set" if @threshold.nil?
|
32
32
|
define
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
def define
|
36
36
|
desc "Verify that rcov coverage is at least #{threshold}%"
|
37
37
|
task @name do
|
@@ -19,7 +19,7 @@ module Spec
|
|
19
19
|
class QuietBacktraceTweaker < BacktraceTweaker
|
20
20
|
unless defined?(IGNORE_PATTERNS)
|
21
21
|
root_dir = File.expand_path(File.join(__FILE__, '..', '..', '..', '..'))
|
22
|
-
spec_files = Dir["#{root_dir}/lib/*"].map do |path|
|
22
|
+
spec_files = Dir["#{root_dir}/lib/*"].map do |path|
|
23
23
|
subpath = path[root_dir.length..-1]
|
24
24
|
/#{subpath}/
|
25
25
|
end
|
@@ -37,7 +37,7 @@ module Spec
|
|
37
37
|
/spec_server/
|
38
38
|
]
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
def tweak_backtrace(error)
|
42
42
|
return if error.backtrace.nil?
|
43
43
|
error.backtrace.collect! do |line|
|