dchelimsky-rspec 1.1.99.6 → 1.1.99.7

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 CHANGED
@@ -1,4 +1,4 @@
1
- === Version 1.1.99.4 (in git)
1
+ === Version 1.1.99.x (in git)
2
2
 
3
3
  WARNINGS:
4
4
 
@@ -28,11 +28,13 @@ WARNINGS:
28
28
  * added explicit autorun feature for running specs with ruby command
29
29
  * added handling for does_not_match? for matchers that want to know the context in which they were called
30
30
  * lots of ruby 1.9.1 compatibility fixes from Chad Humprhies
31
+ * improved feedback from be_kind_of/be_a_kind_of/be_instance_of/be_an_instance_of (Jakub Šťastný)
31
32
 
32
33
  * bug fixes
33
34
 
34
35
  * support delegating operator matchers to subject with should_not
35
36
  * all arguments are included if --drb is specified in spec.opts (Neil Buckley). Closes #671.
37
+ * added --autospec option hack (used internally) to get --color to work when using --drb and autospec.
36
38
 
37
39
  === Version 1.1.12 / 2009-01-11
38
40
 
data/Manifest.txt CHANGED
@@ -113,6 +113,8 @@ lib/spec/interop/test/unit/ui/console/testrunner.rb
113
113
  lib/spec/matchers.rb
114
114
  lib/spec/matchers/be.rb
115
115
  lib/spec/matchers/be_close.rb
116
+ lib/spec/matchers/be_instance_of.rb
117
+ lib/spec/matchers/be_kind_of.rb
116
118
  lib/spec/matchers/change.rb
117
119
  lib/spec/matchers/eql.rb
118
120
  lib/spec/matchers/equal.rb
@@ -226,6 +228,8 @@ spec/spec/interop/test/unit/test_unit_spec_helper.rb
226
228
  spec/spec/interop/test/unit/testcase_spec.rb
227
229
  spec/spec/interop/test/unit/testsuite_adapter_spec.rb
228
230
  spec/spec/matchers/be_close_spec.rb
231
+ spec/spec/matchers/be_instance_of_spec.rb
232
+ spec/spec/matchers/be_kind_of_spec.rb
229
233
  spec/spec/matchers/be_spec.rb
230
234
  spec/spec/matchers/change_spec.rb
231
235
  spec/spec/matchers/description_generation_spec.rb
@@ -38,7 +38,7 @@ class Autotest::Rspec < Autotest
38
38
  def make_test_cmd(files_to_test)
39
39
  return '' if files_to_test.empty?
40
40
  spec_program = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec'))
41
- return "#{ruby} #{spec_program} #{files_to_test.keys.flatten.join(' ')} #{add_options_if_present}"
41
+ return "#{ruby} #{spec_program} --autospec #{files_to_test.keys.flatten.join(' ')} #{add_options_if_present}"
42
42
  end
43
43
 
44
44
  def add_options_if_present # :nodoc:
@@ -0,0 +1,45 @@
1
+ module Spec
2
+ module Matchers
3
+ class BeInstanceOf
4
+ def initialize(expected)
5
+ @expected = expected
6
+ end
7
+
8
+ def matches?(actual)
9
+ @actual = actual
10
+ @actual.instance_of?(@expected)
11
+ end
12
+
13
+ def description
14
+ "be an instance of #{@expected}"
15
+ end
16
+
17
+ def failure_message
18
+ "expected instance of #{@expected}, got #{@actual.inspect}"
19
+ end
20
+
21
+ def negative_failure_message
22
+ "expected #{@actual.inspect} not to be an instance of #{@expected}"
23
+ end
24
+ end
25
+
26
+ # :call-seq:
27
+ # should be_instance_of(expected)
28
+ # should be_an_instance_of(expected)
29
+ # should_not be_instance_of(expected)
30
+ # should_not be_an_instance_of(expected)
31
+ #
32
+ # Passes if actual.instance_of?(expected)
33
+ #
34
+ # == Examples
35
+ #
36
+ # 5.should be_instance_of(Fixnum)
37
+ # 5.should_not be_instance_of(Numeric)
38
+ # 5.should_not be_instance_of(Float)
39
+ def be_instance_of(expected)
40
+ BeInstanceOf.new(expected)
41
+ end
42
+
43
+ alias_method :be_an_instance_of, :be_instance_of
44
+ end
45
+ end
@@ -0,0 +1,45 @@
1
+ module Spec
2
+ module Matchers
3
+ class BeKindOf
4
+ def initialize(expected)
5
+ @expected = expected
6
+ end
7
+
8
+ def matches?(actual)
9
+ @actual = actual
10
+ @actual.kind_of?(@expected)
11
+ end
12
+
13
+ def description
14
+ "be a kind of #{@expected}"
15
+ end
16
+
17
+ def failure_message
18
+ "expected kind of #{@expected}, got #{@actual.inspect}"
19
+ end
20
+
21
+ def negative_failure_message
22
+ "expected #{@actual.inspect} not to be a kind of #{@expected}"
23
+ end
24
+ end
25
+
26
+ # :call-seq:
27
+ # should be_kind_of(expected)
28
+ # should be_a_kind_of(expected)
29
+ # should_not be_kind_of(expected)
30
+ # should_not be_a_kind_of(expected)
31
+ #
32
+ # Passes if actual.kind_of?(expected)
33
+ #
34
+ # == Examples
35
+ #
36
+ # 5.should be_kind_of(Fixnum)
37
+ # 5.should be_kind_of(Numeric)
38
+ # 5.should_not be_kind_of(Float)
39
+ def be_kind_of(expected)
40
+ BeKindOf.new(expected)
41
+ end
42
+
43
+ alias_method :be_a_kind_of, :be_kind_of
44
+ end
45
+ end
data/lib/spec/matchers.rb CHANGED
@@ -1,22 +1,24 @@
1
1
  require 'spec/matchers/operator_matcher'
2
- require 'spec/matchers/generated_descriptions'
3
- require 'spec/matchers/errors'
4
- require 'spec/matchers/method_missing'
5
- require 'spec/matchers/simple_matcher'
6
2
  require 'spec/matchers/be'
7
3
  require 'spec/matchers/be_close'
4
+ require 'spec/matchers/be_instance_of'
5
+ require 'spec/matchers/be_kind_of'
8
6
  require 'spec/matchers/change'
9
- require 'spec/matchers/match_array'
10
7
  require 'spec/matchers/eql'
11
8
  require 'spec/matchers/equal'
9
+ require 'spec/matchers/errors'
12
10
  require 'spec/matchers/exist'
11
+ require 'spec/matchers/generated_descriptions'
13
12
  require 'spec/matchers/has'
14
13
  require 'spec/matchers/have'
15
14
  require 'spec/matchers/include'
16
15
  require 'spec/matchers/match'
16
+ require 'spec/matchers/match_array'
17
+ require 'spec/matchers/method_missing'
17
18
  require 'spec/matchers/raise_error'
18
19
  require 'spec/matchers/respond_to'
19
20
  require 'spec/matchers/satisfy'
21
+ require 'spec/matchers/simple_matcher'
20
22
  require 'spec/matchers/throw_symbol'
21
23
  require 'spec/matchers/wrap_expectation'
22
24
 
@@ -94,11 +94,15 @@ NOTICE
94
94
  protected
95
95
 
96
96
  def colour?
97
- @options.colour ? true : false
97
+ !!@options.colour
98
98
  end
99
99
 
100
100
  def dry_run?
101
- @options.dry_run ? true : false
101
+ !!@options.dry_run
102
+ end
103
+
104
+ def autospec?
105
+ !!@options.autospec
102
106
  end
103
107
 
104
108
  def backtrace_line(line)
@@ -106,7 +110,7 @@ NOTICE
106
110
  end
107
111
 
108
112
  def colour(text, colour_code)
109
- return text unless ENV['RSPEC_COLOR'] || (colour? & output_to_tty?)
113
+ return text unless ENV['RSPEC_COLOR'] || (colour? & (autospec? || output_to_tty?))
110
114
  "#{colour_code}#{text}\e[0m"
111
115
  end
112
116
 
@@ -112,6 +112,7 @@ module Spec
112
112
  on(*OPTIONS[:runner]) {|runner| @options.user_input_for_runner = runner}
113
113
  on(*OPTIONS[:drb]) {}
114
114
  on(*OPTIONS[:version]) {parse_version}
115
+ on("--autospec") {@options.autospec = true}
115
116
  on_tail(*OPTIONS[:help]) {parse_help}
116
117
  end
117
118
 
@@ -24,6 +24,7 @@ module Spec
24
24
  }
25
25
 
26
26
  attr_accessor(
27
+ :autospec, # hack to tell
27
28
  :filename_pattern,
28
29
  :backtrace_tweaker,
29
30
  :context_lines,
data/lib/spec/version.rb CHANGED
@@ -4,7 +4,7 @@ module Spec
4
4
  MAJOR = 1
5
5
  MINOR = 1
6
6
  TINY = 99
7
- MINESCULE = 6
7
+ MINESCULE = 7
8
8
 
9
9
 
10
10
  STRING = [MAJOR, MINOR, TINY, MINESCULE].compact.join('.')
data/rspec.gemspec CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rspec}
5
- s.version = "1.1.99.6"
5
+ s.version = "1.1.99.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["RSpec Development Team"]
9
- s.date = %q{2009-02-15}
9
+ s.date = %q{2009-02-18}
10
10
  s.description = %q{Behaviour Driven Development for Ruby.}
11
11
  s.email = ["rspec-devel@rubyforge.org"]
12
12
  s.executables = ["autospec", "spec"]
13
13
  s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "TODO.txt", "examples/failing/README.txt", "examples/passing/priority.txt", "spec/spec/runner/empty_file.txt", "spec/spec/runner/examples.txt", "spec/spec/runner/failed.txt"]
14
- s.files = [".autotest", "History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "Ruby1.9.markdown", "TODO.txt", "bin/autospec", "bin/spec", "cucumber.yml", "examples/failing/README.txt", "examples/failing/diffing_spec.rb", "examples/failing/failing_autogenerated_docstrings_example.rb", "examples/failing/failure_in_after.rb", "examples/failing/failure_in_before.rb", "examples/failing/mocking_example.rb", "examples/failing/mocking_with_flexmock.rb", "examples/failing/mocking_with_mocha.rb", "examples/failing/mocking_with_rr.rb", "examples/failing/partial_mock_example.rb", "examples/failing/predicate_example.rb", "examples/failing/raising_example.rb", "examples/failing/spec_helper.rb", "examples/failing/syntax_error_example.rb", "examples/failing/team_spec.rb", "examples/failing/timeout_behaviour.rb", "examples/passing/autogenerated_docstrings_example.rb", "examples/passing/before_and_after_example.rb", "examples/passing/behave_as_example.rb", "examples/passing/custom_expectation_matchers.rb", "examples/passing/custom_formatter.rb", "examples/passing/dynamic_spec.rb", "examples/passing/file_accessor.rb", "examples/passing/file_accessor_spec.rb", "examples/passing/filtered_formatter.rb", "examples/passing/filtered_formatter_example.rb", "examples/passing/greeter_spec.rb", "examples/passing/helper_method_example.rb", "examples/passing/io_processor.rb", "examples/passing/io_processor_spec.rb", "examples/passing/mocking_example.rb", "examples/passing/multi_threaded_example_group_runner.rb", "examples/passing/nested_classes_example.rb", "examples/passing/partial_mock_example.rb", "examples/passing/pending_example.rb", "examples/passing/predicate_example.rb", "examples/passing/priority.txt", "examples/passing/shared_example_group_example.rb", "examples/passing/shared_stack_examples.rb", "examples/passing/simple_matcher_example.rb", "examples/passing/spec_helper.rb", "examples/passing/stack.rb", "examples/passing/stack_spec.rb", "examples/passing/stack_spec_with_nested_example_groups.rb", "examples/passing/stubbing_example.rb", "examples/passing/yielding_example.rb", "examples/ruby1.9.compatibility/access_to_constants_spec.rb", "features-pending/cli/conditional_exclusion.feature", "features/before_and_after_blocks/before_and_after_blocks.feature", "features/example_groups/autogenerated_docstrings.feature", "features/example_groups/example_group_with_should_methods.feature", "features/example_groups/nested_groups.feature", "features/example_groups/output.feature", "features/heckle/heckle.feature", "features/interop/examples_and_tests_together.feature", "features/interop/test_but_not_test_unit.feature", "features/interop/test_case_with_should_methods.feature", "features/mock_framework_integration/use_flexmock.feature", "features/mock_framework_integration/use_mocha.feature", "features/mock_framework_integration/use_rr.feature", "features/step_definitions/running_rspec.rb", "features/support/env.rb", "features/support/matchers/smart_match.rb", "init.rb", "lib/autotest/discover.rb", "lib/autotest/rspec.rb", "lib/spec.rb", "lib/spec/adapters/mock_frameworks/flexmock.rb", "lib/spec/adapters/mock_frameworks/mocha.rb", "lib/spec/adapters/mock_frameworks/rr.rb", "lib/spec/adapters/mock_frameworks/rspec.rb", "lib/spec/autorun.rb", "lib/spec/dsl.rb", "lib/spec/dsl/main.rb", "lib/spec/example.rb", "lib/spec/example/before_and_after_hooks.rb", "lib/spec/example/errors.rb", "lib/spec/example/example_description.rb", "lib/spec/example/example_group.rb", "lib/spec/example/example_group_factory.rb", "lib/spec/example/example_group_hierarchy.rb", "lib/spec/example/example_group_methods.rb", "lib/spec/example/example_matcher.rb", "lib/spec/example/example_methods.rb", "lib/spec/example/module_reopening_fix.rb", "lib/spec/example/pending.rb", "lib/spec/example/predicate_matchers.rb", "lib/spec/example/shared_example_group.rb", "lib/spec/example/subject.rb", "lib/spec/expectations.rb", "lib/spec/expectations/differs/default.rb", "lib/spec/expectations/errors.rb", "lib/spec/expectations/extensions.rb", "lib/spec/expectations/extensions/object.rb", "lib/spec/expectations/handler.rb", "lib/spec/interop/test.rb", "lib/spec/interop/test/unit/autorunner.rb", "lib/spec/interop/test/unit/testcase.rb", "lib/spec/interop/test/unit/testresult.rb", "lib/spec/interop/test/unit/testsuite_adapter.rb", "lib/spec/interop/test/unit/ui/console/testrunner.rb", "lib/spec/matchers.rb", "lib/spec/matchers/be.rb", "lib/spec/matchers/be_close.rb", "lib/spec/matchers/change.rb", "lib/spec/matchers/eql.rb", "lib/spec/matchers/equal.rb", "lib/spec/matchers/errors.rb", "lib/spec/matchers/exist.rb", "lib/spec/matchers/generated_descriptions.rb", "lib/spec/matchers/has.rb", "lib/spec/matchers/have.rb", "lib/spec/matchers/include.rb", "lib/spec/matchers/match.rb", "lib/spec/matchers/match_array.rb", "lib/spec/matchers/method_missing.rb", "lib/spec/matchers/operator_matcher.rb", "lib/spec/matchers/raise_error.rb", "lib/spec/matchers/respond_to.rb", "lib/spec/matchers/satisfy.rb", "lib/spec/matchers/simple_matcher.rb", "lib/spec/matchers/throw_symbol.rb", "lib/spec/matchers/wrap_expectation.rb", "lib/spec/mocks.rb", "lib/spec/mocks/argument_expectation.rb", "lib/spec/mocks/argument_matchers.rb", "lib/spec/mocks/error_generator.rb", "lib/spec/mocks/errors.rb", "lib/spec/mocks/extensions.rb", "lib/spec/mocks/extensions/object.rb", "lib/spec/mocks/framework.rb", "lib/spec/mocks/message_expectation.rb", "lib/spec/mocks/methods.rb", "lib/spec/mocks/mock.rb", "lib/spec/mocks/order_group.rb", "lib/spec/mocks/proxy.rb", "lib/spec/mocks/space.rb", "lib/spec/mocks/spec_methods.rb", "lib/spec/rake/spectask.rb", "lib/spec/rake/verify_rcov.rb", "lib/spec/ruby.rb", "lib/spec/runner.rb", "lib/spec/runner/backtrace_tweaker.rb", "lib/spec/runner/class_and_arguments_parser.rb", "lib/spec/runner/command_line.rb", "lib/spec/runner/configuration.rb", "lib/spec/runner/drb_command_line.rb", "lib/spec/runner/example_group_runner.rb", "lib/spec/runner/formatter/base_formatter.rb", "lib/spec/runner/formatter/base_text_formatter.rb", "lib/spec/runner/formatter/failing_example_groups_formatter.rb", "lib/spec/runner/formatter/failing_examples_formatter.rb", "lib/spec/runner/formatter/html_formatter.rb", "lib/spec/runner/formatter/nested_text_formatter.rb", "lib/spec/runner/formatter/profile_formatter.rb", "lib/spec/runner/formatter/progress_bar_formatter.rb", "lib/spec/runner/formatter/snippet_extractor.rb", "lib/spec/runner/formatter/specdoc_formatter.rb", "lib/spec/runner/formatter/text_mate_formatter.rb", "lib/spec/runner/heckle_runner.rb", "lib/spec/runner/heckle_runner_unsupported.rb", "lib/spec/runner/option_parser.rb", "lib/spec/runner/options.rb", "lib/spec/runner/reporter.rb", "lib/spec/runner/spec_parser.rb", "lib/spec/test/unit.rb", "lib/spec/version.rb", "resources/helpers/cmdline.rb", "resources/rake/examples.rake", "resources/rake/examples_with_rcov.rake", "resources/rake/failing_examples_with_html.rake", "resources/rake/verify_rcov.rake", "resources/spec/example_group_with_should_methods.rb", "resources/spec/simple_spec.rb", "resources/test/spec_and_test_together.rb", "resources/test/spec_including_test_but_not_unit.rb", "resources/test/test_case_with_should_methods.rb", "rspec.gemspec", "spec/README.jruby", "spec/autotest/autotest_helper.rb", "spec/autotest/autotest_matchers.rb", "spec/autotest/discover_spec.rb", "spec/autotest/failed_results_re_spec.rb", "spec/autotest/rspec_spec.rb", "spec/rspec_suite.rb", "spec/ruby_forker.rb", "spec/spec.opts", "spec/spec/dsl/main_spec.rb", "spec/spec/example/example_group_class_definition_spec.rb", "spec/spec/example/example_group_factory_spec.rb", "spec/spec/example/example_group_methods_spec.rb", "spec/spec/example/example_group_spec.rb", "spec/spec/example/example_matcher_spec.rb", "spec/spec/example/example_methods_spec.rb", "spec/spec/example/helper_method_spec.rb", "spec/spec/example/nested_example_group_spec.rb", "spec/spec/example/pending_module_spec.rb", "spec/spec/example/predicate_matcher_spec.rb", "spec/spec/example/shared_example_group_spec.rb", "spec/spec/example/subclassing_example_group_spec.rb", "spec/spec/expectations/differs/default_spec.rb", "spec/spec/expectations/extensions/object_spec.rb", "spec/spec/expectations/fail_with_spec.rb", "spec/spec/expectations/wrap_expectation_spec.rb", "spec/spec/interop/test/unit/resources/spec_that_fails.rb", "spec/spec/interop/test/unit/resources/spec_that_passes.rb", "spec/spec/interop/test/unit/resources/spec_with_errors.rb", "spec/spec/interop/test/unit/resources/spec_with_options_hash.rb", "spec/spec/interop/test/unit/resources/test_case_that_fails.rb", "spec/spec/interop/test/unit/resources/test_case_that_passes.rb", "spec/spec/interop/test/unit/resources/test_case_with_errors.rb", "spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb", "spec/spec/interop/test/unit/spec_spec.rb", "spec/spec/interop/test/unit/test_unit_spec_helper.rb", "spec/spec/interop/test/unit/testcase_spec.rb", "spec/spec/interop/test/unit/testsuite_adapter_spec.rb", "spec/spec/matchers/be_close_spec.rb", "spec/spec/matchers/be_spec.rb", "spec/spec/matchers/change_spec.rb", "spec/spec/matchers/description_generation_spec.rb", "spec/spec/matchers/eql_spec.rb", "spec/spec/matchers/equal_spec.rb", "spec/spec/matchers/exist_spec.rb", "spec/spec/matchers/handler_spec.rb", "spec/spec/matchers/has_spec.rb", "spec/spec/matchers/have_spec.rb", "spec/spec/matchers/include_spec.rb", "spec/spec/matchers/match_array_spec.rb", "spec/spec/matchers/match_spec.rb", "spec/spec/matchers/matcher_methods_spec.rb", "spec/spec/matchers/operator_matcher_spec.rb", "spec/spec/matchers/raise_error_spec.rb", "spec/spec/matchers/respond_to_spec.rb", "spec/spec/matchers/satisfy_spec.rb", "spec/spec/matchers/simple_matcher_spec.rb", "spec/spec/matchers/throw_symbol_spec.rb", "spec/spec/mocks/any_number_of_times_spec.rb", "spec/spec/mocks/argument_expectation_spec.rb", "spec/spec/mocks/at_least_spec.rb", "spec/spec/mocks/at_most_spec.rb", "spec/spec/mocks/bug_report_10260_spec.rb", "spec/spec/mocks/bug_report_10263_spec.rb", "spec/spec/mocks/bug_report_11545_spec.rb", "spec/spec/mocks/bug_report_15719_spec.rb", "spec/spec/mocks/bug_report_496_spec.rb", "spec/spec/mocks/bug_report_600_spec.rb", "spec/spec/mocks/bug_report_7611_spec.rb", "spec/spec/mocks/bug_report_7805_spec.rb", "spec/spec/mocks/bug_report_8165_spec.rb", "spec/spec/mocks/bug_report_8302_spec.rb", "spec/spec/mocks/failing_argument_matchers_spec.rb", "spec/spec/mocks/hash_including_matcher_spec.rb", "spec/spec/mocks/hash_not_including_matcher_spec.rb", "spec/spec/mocks/mock_ordering_spec.rb", "spec/spec/mocks/mock_space_spec.rb", "spec/spec/mocks/mock_spec.rb", "spec/spec/mocks/multiple_return_value_spec.rb", "spec/spec/mocks/nil_expectation_warning_spec.rb", "spec/spec/mocks/null_object_mock_spec.rb", "spec/spec/mocks/once_counts_spec.rb", "spec/spec/mocks/options_hash_spec.rb", "spec/spec/mocks/partial_mock_spec.rb", "spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb", "spec/spec/mocks/passing_argument_matchers_spec.rb", "spec/spec/mocks/precise_counts_spec.rb", "spec/spec/mocks/record_messages_spec.rb", "spec/spec/mocks/stub_spec.rb", "spec/spec/mocks/stubbed_message_expectations_spec.rb", "spec/spec/mocks/twice_counts_spec.rb", "spec/spec/package/bin_spec_spec.rb", "spec/spec/runner/class_and_argument_parser_spec.rb", "spec/spec/runner/command_line_spec.rb", "spec/spec/runner/configuration_spec.rb", "spec/spec/runner/drb_command_line_spec.rb", "spec/spec/runner/empty_file.txt", "spec/spec/runner/example_group_runner_spec.rb", "spec/spec/runner/examples.txt", "spec/spec/runner/failed.txt", "spec/spec/runner/formatter/base_formatter_spec.rb", "spec/spec/runner/formatter/base_text_formatter_spec.rb", "spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb", "spec/spec/runner/formatter/failing_examples_formatter_spec.rb", "spec/spec/runner/formatter/html_formatted-1.8.4.html", "spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html", "spec/spec/runner/formatter/html_formatted-1.8.5.html", "spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html", "spec/spec/runner/formatter/html_formatted-1.8.6.html", "spec/spec/runner/formatter/html_formatted-1.8.7.html", "spec/spec/runner/formatter/html_formatted-1.9.1.html", "spec/spec/runner/formatter/html_formatter_spec.rb", "spec/spec/runner/formatter/nested_text_formatter_spec.rb", "spec/spec/runner/formatter/profile_formatter_spec.rb", "spec/spec/runner/formatter/progress_bar_formatter_spec.rb", "spec/spec/runner/formatter/snippet_extractor_spec.rb", "spec/spec/runner/formatter/specdoc_formatter_spec.rb", "spec/spec/runner/formatter/text_mate_formatted-1.8.4.html", "spec/spec/runner/formatter/text_mate_formatted-1.8.6.html", "spec/spec/runner/formatter/text_mate_formatted-1.8.7.html", "spec/spec/runner/formatter/text_mate_formatted-1.9.1.html", "spec/spec/runner/formatter/text_mate_formatter_spec.rb", "spec/spec/runner/heckle_runner_spec.rb", "spec/spec/runner/heckler_spec.rb", "spec/spec/runner/noisy_backtrace_tweaker_spec.rb", "spec/spec/runner/option_parser_spec.rb", "spec/spec/runner/options_spec.rb", "spec/spec/runner/output_one_time_fixture.rb", "spec/spec/runner/output_one_time_fixture_runner.rb", "spec/spec/runner/output_one_time_spec.rb", "spec/spec/runner/quiet_backtrace_tweaker_spec.rb", "spec/spec/runner/reporter_spec.rb", "spec/spec/runner/resources/a_bar.rb", "spec/spec/runner/resources/a_foo.rb", "spec/spec/runner/resources/a_spec.rb", "spec/spec/runner/resources/custom_example_group_runner.rb", "spec/spec/runner/resources/utf8_encoded.rb", "spec/spec/runner/spec.opts", "spec/spec/runner/spec_drb.opts", "spec/spec/runner/spec_parser/spec_parser_fixture.rb", "spec/spec/runner/spec_parser_spec.rb", "spec/spec/runner/spec_spaced.opts", "spec/spec/runner_spec.rb", "spec/spec/spec_classes.rb", "spec/spec_helper.rb"]
14
+ s.files = [".autotest", "History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "Ruby1.9.markdown", "TODO.txt", "bin/autospec", "bin/spec", "cucumber.yml", "examples/failing/README.txt", "examples/failing/diffing_spec.rb", "examples/failing/failing_autogenerated_docstrings_example.rb", "examples/failing/failure_in_after.rb", "examples/failing/failure_in_before.rb", "examples/failing/mocking_example.rb", "examples/failing/mocking_with_flexmock.rb", "examples/failing/mocking_with_mocha.rb", "examples/failing/mocking_with_rr.rb", "examples/failing/partial_mock_example.rb", "examples/failing/predicate_example.rb", "examples/failing/raising_example.rb", "examples/failing/spec_helper.rb", "examples/failing/syntax_error_example.rb", "examples/failing/team_spec.rb", "examples/failing/timeout_behaviour.rb", "examples/passing/autogenerated_docstrings_example.rb", "examples/passing/before_and_after_example.rb", "examples/passing/behave_as_example.rb", "examples/passing/custom_expectation_matchers.rb", "examples/passing/custom_formatter.rb", "examples/passing/dynamic_spec.rb", "examples/passing/file_accessor.rb", "examples/passing/file_accessor_spec.rb", "examples/passing/filtered_formatter.rb", "examples/passing/filtered_formatter_example.rb", "examples/passing/greeter_spec.rb", "examples/passing/helper_method_example.rb", "examples/passing/io_processor.rb", "examples/passing/io_processor_spec.rb", "examples/passing/mocking_example.rb", "examples/passing/multi_threaded_example_group_runner.rb", "examples/passing/nested_classes_example.rb", "examples/passing/partial_mock_example.rb", "examples/passing/pending_example.rb", "examples/passing/predicate_example.rb", "examples/passing/priority.txt", "examples/passing/shared_example_group_example.rb", "examples/passing/shared_stack_examples.rb", "examples/passing/simple_matcher_example.rb", "examples/passing/spec_helper.rb", "examples/passing/stack.rb", "examples/passing/stack_spec.rb", "examples/passing/stack_spec_with_nested_example_groups.rb", "examples/passing/stubbing_example.rb", "examples/passing/yielding_example.rb", "examples/ruby1.9.compatibility/access_to_constants_spec.rb", "features-pending/cli/conditional_exclusion.feature", "features/before_and_after_blocks/before_and_after_blocks.feature", "features/example_groups/autogenerated_docstrings.feature", "features/example_groups/example_group_with_should_methods.feature", "features/example_groups/nested_groups.feature", "features/example_groups/output.feature", "features/heckle/heckle.feature", "features/interop/examples_and_tests_together.feature", "features/interop/test_but_not_test_unit.feature", "features/interop/test_case_with_should_methods.feature", "features/mock_framework_integration/use_flexmock.feature", "features/mock_framework_integration/use_mocha.feature", "features/mock_framework_integration/use_rr.feature", "features/step_definitions/running_rspec.rb", "features/support/env.rb", "features/support/matchers/smart_match.rb", "init.rb", "lib/autotest/discover.rb", "lib/autotest/rspec.rb", "lib/spec.rb", "lib/spec/adapters/mock_frameworks/flexmock.rb", "lib/spec/adapters/mock_frameworks/mocha.rb", "lib/spec/adapters/mock_frameworks/rr.rb", "lib/spec/adapters/mock_frameworks/rspec.rb", "lib/spec/autorun.rb", "lib/spec/dsl.rb", "lib/spec/dsl/main.rb", "lib/spec/example.rb", "lib/spec/example/before_and_after_hooks.rb", "lib/spec/example/errors.rb", "lib/spec/example/example_description.rb", "lib/spec/example/example_group.rb", "lib/spec/example/example_group_factory.rb", "lib/spec/example/example_group_hierarchy.rb", "lib/spec/example/example_group_methods.rb", "lib/spec/example/example_matcher.rb", "lib/spec/example/example_methods.rb", "lib/spec/example/module_reopening_fix.rb", "lib/spec/example/pending.rb", "lib/spec/example/predicate_matchers.rb", "lib/spec/example/shared_example_group.rb", "lib/spec/example/subject.rb", "lib/spec/expectations.rb", "lib/spec/expectations/differs/default.rb", "lib/spec/expectations/errors.rb", "lib/spec/expectations/extensions.rb", "lib/spec/expectations/extensions/object.rb", "lib/spec/expectations/handler.rb", "lib/spec/interop/test.rb", "lib/spec/interop/test/unit/autorunner.rb", "lib/spec/interop/test/unit/testcase.rb", "lib/spec/interop/test/unit/testresult.rb", "lib/spec/interop/test/unit/testsuite_adapter.rb", "lib/spec/interop/test/unit/ui/console/testrunner.rb", "lib/spec/matchers.rb", "lib/spec/matchers/be.rb", "lib/spec/matchers/be_close.rb", "lib/spec/matchers/be_instance_of.rb", "lib/spec/matchers/be_kind_of.rb", "lib/spec/matchers/change.rb", "lib/spec/matchers/eql.rb", "lib/spec/matchers/equal.rb", "lib/spec/matchers/errors.rb", "lib/spec/matchers/exist.rb", "lib/spec/matchers/generated_descriptions.rb", "lib/spec/matchers/has.rb", "lib/spec/matchers/have.rb", "lib/spec/matchers/include.rb", "lib/spec/matchers/match.rb", "lib/spec/matchers/match_array.rb", "lib/spec/matchers/method_missing.rb", "lib/spec/matchers/operator_matcher.rb", "lib/spec/matchers/raise_error.rb", "lib/spec/matchers/respond_to.rb", "lib/spec/matchers/satisfy.rb", "lib/spec/matchers/simple_matcher.rb", "lib/spec/matchers/throw_symbol.rb", "lib/spec/matchers/wrap_expectation.rb", "lib/spec/mocks.rb", "lib/spec/mocks/argument_expectation.rb", "lib/spec/mocks/argument_matchers.rb", "lib/spec/mocks/error_generator.rb", "lib/spec/mocks/errors.rb", "lib/spec/mocks/extensions.rb", "lib/spec/mocks/extensions/object.rb", "lib/spec/mocks/framework.rb", "lib/spec/mocks/message_expectation.rb", "lib/spec/mocks/methods.rb", "lib/spec/mocks/mock.rb", "lib/spec/mocks/order_group.rb", "lib/spec/mocks/proxy.rb", "lib/spec/mocks/space.rb", "lib/spec/mocks/spec_methods.rb", "lib/spec/rake/spectask.rb", "lib/spec/rake/verify_rcov.rb", "lib/spec/ruby.rb", "lib/spec/runner.rb", "lib/spec/runner/backtrace_tweaker.rb", "lib/spec/runner/class_and_arguments_parser.rb", "lib/spec/runner/command_line.rb", "lib/spec/runner/configuration.rb", "lib/spec/runner/drb_command_line.rb", "lib/spec/runner/example_group_runner.rb", "lib/spec/runner/formatter/base_formatter.rb", "lib/spec/runner/formatter/base_text_formatter.rb", "lib/spec/runner/formatter/failing_example_groups_formatter.rb", "lib/spec/runner/formatter/failing_examples_formatter.rb", "lib/spec/runner/formatter/html_formatter.rb", "lib/spec/runner/formatter/nested_text_formatter.rb", "lib/spec/runner/formatter/profile_formatter.rb", "lib/spec/runner/formatter/progress_bar_formatter.rb", "lib/spec/runner/formatter/snippet_extractor.rb", "lib/spec/runner/formatter/specdoc_formatter.rb", "lib/spec/runner/formatter/text_mate_formatter.rb", "lib/spec/runner/heckle_runner.rb", "lib/spec/runner/heckle_runner_unsupported.rb", "lib/spec/runner/option_parser.rb", "lib/spec/runner/options.rb", "lib/spec/runner/reporter.rb", "lib/spec/runner/spec_parser.rb", "lib/spec/test/unit.rb", "lib/spec/version.rb", "resources/helpers/cmdline.rb", "resources/rake/examples.rake", "resources/rake/examples_with_rcov.rake", "resources/rake/failing_examples_with_html.rake", "resources/rake/verify_rcov.rake", "resources/spec/example_group_with_should_methods.rb", "resources/spec/simple_spec.rb", "resources/test/spec_and_test_together.rb", "resources/test/spec_including_test_but_not_unit.rb", "resources/test/test_case_with_should_methods.rb", "rspec.gemspec", "spec/README.jruby", "spec/autotest/autotest_helper.rb", "spec/autotest/autotest_matchers.rb", "spec/autotest/discover_spec.rb", "spec/autotest/failed_results_re_spec.rb", "spec/autotest/rspec_spec.rb", "spec/rspec_suite.rb", "spec/ruby_forker.rb", "spec/spec.opts", "spec/spec/dsl/main_spec.rb", "spec/spec/example/example_group_class_definition_spec.rb", "spec/spec/example/example_group_factory_spec.rb", "spec/spec/example/example_group_methods_spec.rb", "spec/spec/example/example_group_spec.rb", "spec/spec/example/example_matcher_spec.rb", "spec/spec/example/example_methods_spec.rb", "spec/spec/example/helper_method_spec.rb", "spec/spec/example/nested_example_group_spec.rb", "spec/spec/example/pending_module_spec.rb", "spec/spec/example/predicate_matcher_spec.rb", "spec/spec/example/shared_example_group_spec.rb", "spec/spec/example/subclassing_example_group_spec.rb", "spec/spec/expectations/differs/default_spec.rb", "spec/spec/expectations/extensions/object_spec.rb", "spec/spec/expectations/fail_with_spec.rb", "spec/spec/expectations/wrap_expectation_spec.rb", "spec/spec/interop/test/unit/resources/spec_that_fails.rb", "spec/spec/interop/test/unit/resources/spec_that_passes.rb", "spec/spec/interop/test/unit/resources/spec_with_errors.rb", "spec/spec/interop/test/unit/resources/spec_with_options_hash.rb", "spec/spec/interop/test/unit/resources/test_case_that_fails.rb", "spec/spec/interop/test/unit/resources/test_case_that_passes.rb", "spec/spec/interop/test/unit/resources/test_case_with_errors.rb", "spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb", "spec/spec/interop/test/unit/spec_spec.rb", "spec/spec/interop/test/unit/test_unit_spec_helper.rb", "spec/spec/interop/test/unit/testcase_spec.rb", "spec/spec/interop/test/unit/testsuite_adapter_spec.rb", "spec/spec/matchers/be_close_spec.rb", "spec/spec/matchers/be_instance_of_spec.rb", "spec/spec/matchers/be_kind_of_spec.rb", "spec/spec/matchers/be_spec.rb", "spec/spec/matchers/change_spec.rb", "spec/spec/matchers/description_generation_spec.rb", "spec/spec/matchers/eql_spec.rb", "spec/spec/matchers/equal_spec.rb", "spec/spec/matchers/exist_spec.rb", "spec/spec/matchers/handler_spec.rb", "spec/spec/matchers/has_spec.rb", "spec/spec/matchers/have_spec.rb", "spec/spec/matchers/include_spec.rb", "spec/spec/matchers/match_array_spec.rb", "spec/spec/matchers/match_spec.rb", "spec/spec/matchers/matcher_methods_spec.rb", "spec/spec/matchers/operator_matcher_spec.rb", "spec/spec/matchers/raise_error_spec.rb", "spec/spec/matchers/respond_to_spec.rb", "spec/spec/matchers/satisfy_spec.rb", "spec/spec/matchers/simple_matcher_spec.rb", "spec/spec/matchers/throw_symbol_spec.rb", "spec/spec/mocks/any_number_of_times_spec.rb", "spec/spec/mocks/argument_expectation_spec.rb", "spec/spec/mocks/at_least_spec.rb", "spec/spec/mocks/at_most_spec.rb", "spec/spec/mocks/bug_report_10260_spec.rb", "spec/spec/mocks/bug_report_10263_spec.rb", "spec/spec/mocks/bug_report_11545_spec.rb", "spec/spec/mocks/bug_report_15719_spec.rb", "spec/spec/mocks/bug_report_496_spec.rb", "spec/spec/mocks/bug_report_600_spec.rb", "spec/spec/mocks/bug_report_7611_spec.rb", "spec/spec/mocks/bug_report_7805_spec.rb", "spec/spec/mocks/bug_report_8165_spec.rb", "spec/spec/mocks/bug_report_8302_spec.rb", "spec/spec/mocks/failing_argument_matchers_spec.rb", "spec/spec/mocks/hash_including_matcher_spec.rb", "spec/spec/mocks/hash_not_including_matcher_spec.rb", "spec/spec/mocks/mock_ordering_spec.rb", "spec/spec/mocks/mock_space_spec.rb", "spec/spec/mocks/mock_spec.rb", "spec/spec/mocks/multiple_return_value_spec.rb", "spec/spec/mocks/nil_expectation_warning_spec.rb", "spec/spec/mocks/null_object_mock_spec.rb", "spec/spec/mocks/once_counts_spec.rb", "spec/spec/mocks/options_hash_spec.rb", "spec/spec/mocks/partial_mock_spec.rb", "spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb", "spec/spec/mocks/passing_argument_matchers_spec.rb", "spec/spec/mocks/precise_counts_spec.rb", "spec/spec/mocks/record_messages_spec.rb", "spec/spec/mocks/stub_spec.rb", "spec/spec/mocks/stubbed_message_expectations_spec.rb", "spec/spec/mocks/twice_counts_spec.rb", "spec/spec/package/bin_spec_spec.rb", "spec/spec/runner/class_and_argument_parser_spec.rb", "spec/spec/runner/command_line_spec.rb", "spec/spec/runner/configuration_spec.rb", "spec/spec/runner/drb_command_line_spec.rb", "spec/spec/runner/empty_file.txt", "spec/spec/runner/example_group_runner_spec.rb", "spec/spec/runner/examples.txt", "spec/spec/runner/failed.txt", "spec/spec/runner/formatter/base_formatter_spec.rb", "spec/spec/runner/formatter/base_text_formatter_spec.rb", "spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb", "spec/spec/runner/formatter/failing_examples_formatter_spec.rb", "spec/spec/runner/formatter/html_formatted-1.8.4.html", "spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html", "spec/spec/runner/formatter/html_formatted-1.8.5.html", "spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html", "spec/spec/runner/formatter/html_formatted-1.8.6.html", "spec/spec/runner/formatter/html_formatted-1.8.7.html", "spec/spec/runner/formatter/html_formatted-1.9.1.html", "spec/spec/runner/formatter/html_formatter_spec.rb", "spec/spec/runner/formatter/nested_text_formatter_spec.rb", "spec/spec/runner/formatter/profile_formatter_spec.rb", "spec/spec/runner/formatter/progress_bar_formatter_spec.rb", "spec/spec/runner/formatter/snippet_extractor_spec.rb", "spec/spec/runner/formatter/specdoc_formatter_spec.rb", "spec/spec/runner/formatter/text_mate_formatted-1.8.4.html", "spec/spec/runner/formatter/text_mate_formatted-1.8.6.html", "spec/spec/runner/formatter/text_mate_formatted-1.8.7.html", "spec/spec/runner/formatter/text_mate_formatted-1.9.1.html", "spec/spec/runner/formatter/text_mate_formatter_spec.rb", "spec/spec/runner/heckle_runner_spec.rb", "spec/spec/runner/heckler_spec.rb", "spec/spec/runner/noisy_backtrace_tweaker_spec.rb", "spec/spec/runner/option_parser_spec.rb", "spec/spec/runner/options_spec.rb", "spec/spec/runner/output_one_time_fixture.rb", "spec/spec/runner/output_one_time_fixture_runner.rb", "spec/spec/runner/output_one_time_spec.rb", "spec/spec/runner/quiet_backtrace_tweaker_spec.rb", "spec/spec/runner/reporter_spec.rb", "spec/spec/runner/resources/a_bar.rb", "spec/spec/runner/resources/a_foo.rb", "spec/spec/runner/resources/a_spec.rb", "spec/spec/runner/resources/custom_example_group_runner.rb", "spec/spec/runner/resources/utf8_encoded.rb", "spec/spec/runner/spec.opts", "spec/spec/runner/spec_drb.opts", "spec/spec/runner/spec_parser/spec_parser_fixture.rb", "spec/spec/runner/spec_parser_spec.rb", "spec/spec/runner/spec_spaced.opts", "spec/spec/runner_spec.rb", "spec/spec/spec_classes.rb", "spec/spec_helper.rb"]
15
15
  s.has_rdoc = true
16
16
  s.homepage = %q{http://rspec.info/}
17
17
  s.rdoc_options = ["--main", "README.txt"]
18
18
  s.require_paths = ["lib"]
19
19
  s.rubyforge_project = %q{rspec}
20
20
  s.rubygems_version = %q{1.3.1}
21
- s.summary = %q{rspec 1.1.99.6}
21
+ s.summary = %q{rspec 1.1.99.7}
22
22
 
23
23
  if s.respond_to? :specification_version then
24
24
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -36,7 +36,7 @@ describe Autotest::Rspec do
36
36
  end
37
37
 
38
38
  it "should make the appropriate test command" do
39
- @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} #{@spec_cmd} #{@to_test} #{@options}"
39
+ @rspec_autotest.make_test_cmd(@files_to_test).should == "#{@ruby} #{@spec_cmd} --autospec #{@to_test} #{@options}"
40
40
  end
41
41
 
42
42
  it "should return a blank command for no files" do
@@ -0,0 +1,29 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
+
3
+ module Spec
4
+ module Matchers
5
+ [:be_instance_of, :be_an_instance_of].each do |method|
6
+ describe "#{method}" do
7
+ it "passes if object is instance of given class" do
8
+ 5.should send(method, Fixnum)
9
+ end
10
+
11
+ it "failse if object is instance of subclass of expected class" do
12
+ lambda { 5.should send(method, Numeric) }.should fail_with(%Q{expected instance of Numeric, got 5})
13
+ end
14
+
15
+ it "fails with failure message unless object is kind of given class" do
16
+ lambda { "foo".should send(method, Array) }.should fail_with(%Q{expected instance of Array, got "foo"})
17
+ end
18
+
19
+ it "fails with negative failure message if object is kind of given class" do
20
+ lambda { "foo".should_not send(method, String) }.should fail_with(%Q{expected "foo" not to be an instance of String})
21
+ end
22
+
23
+ it "provides a description" do
24
+ Spec::Matchers::BeInstanceOf.new(Class).description.should == "be an instance of Class"
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
+
3
+ module Spec
4
+ module Matchers
5
+ [:be_kind_of, :be_a_kind_of].each do |method|
6
+ describe "#{method}" do
7
+ it "passes if object is instance of given class" do
8
+ 5.should send(method, Fixnum)
9
+ end
10
+
11
+ it "passes if object is instance of subclass of expected class" do
12
+ 5.should send(method, Numeric)
13
+ end
14
+
15
+ it "fails with failure message unless object is kind of given class" do
16
+ lambda { "foo".should send(method, Array) }.should fail_with(%Q{expected kind of Array, got "foo"})
17
+ end
18
+
19
+ it "fails with negative failure message if object is kind of given class" do
20
+ lambda { "foo".should_not send(method, String) }.should fail_with(%Q{expected "foo" not to be a kind of String})
21
+ end
22
+
23
+ it "provides a description" do
24
+ Spec::Matchers::BeKindOf.new(Class).description.should == "be a kind of Class"
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -50,18 +50,6 @@ describe "Matchers should be able to generate their own descriptions" do
50
50
  Spec::Matchers.generated_description.should == "should be between 0 and 10"
51
51
  end
52
52
 
53
- it "should be_few_words predicate should be transformed to 'be few words'" do
54
- 5.should be_kind_of(Fixnum)
55
- Spec::Matchers.generated_description.should == "should be kind of Fixnum"
56
- end
57
-
58
- it "should preserve a proper prefix for be predicate" do
59
- 5.should be_a_kind_of(Fixnum)
60
- Spec::Matchers.generated_description.should == "should be a kind of Fixnum"
61
- 5.should be_an_instance_of(Fixnum)
62
- Spec::Matchers.generated_description.should == "should be an instance of Fixnum"
63
- end
64
-
65
53
  it "should equal" do
66
54
  expected = "expected"
67
55
  expected.should equal(expected)
@@ -2,96 +2,94 @@ require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
2
 
3
3
  module Spec
4
4
  module Runner
5
- describe DrbCommandLine, "without running local server" do
6
- unless jruby?
7
- it "should print error when there is no running local server" do
8
- err = StringIO.new
9
- out = StringIO.new
10
- DrbCommandLine.run(OptionParser.parse(['--version'], err, out))
5
+ unless jruby?
6
+ describe DrbCommandLine do
11
7
 
12
- err.rewind
13
- err.read.should =~ /No server is running/
14
- end
15
- end
16
- end
8
+ context "without server running" do
9
+ it "should print error when there is no running local server" do
10
+ err = out = StringIO.new
11
+ DrbCommandLine.run(OptionParser.parse(['--version'], err, out))
17
12
 
18
- describe "with local server" do
13
+ err.rewind
14
+ err.read.should =~ /No server is running/
15
+ end
16
+ end
19
17
 
20
- class ::CommandLineForSpec
21
- def self.run(argv, stderr, stdout)
22
- orig_options = Spec::Runner.options
23
- tmp_options = Spec::Runner::OptionParser.parse(argv, stderr, stdout)
24
- Spec::Runner.use tmp_options
25
- Spec::Runner::CommandLine.run(tmp_options)
26
- ensure
27
- Spec::Runner.use orig_options
28
- end
29
- end
30
-
31
- unless jruby?
32
- before(:all) do
33
- DRb.start_service("druby://127.0.0.1:8989", ::CommandLineForSpec)
34
- @@drb_example_file_counter = 0
35
- end
18
+ context "with server running" do
19
+ class ::CommandLineForDrbSpec
20
+ def self.run(argv, stderr, stdout)
21
+ orig_options = Spec::Runner.options
22
+ tmp_options = Spec::Runner::OptionParser.parse(argv, stderr, stdout)
23
+ Spec::Runner.use tmp_options
24
+ Spec::Runner::CommandLine.run(tmp_options)
25
+ ensure
26
+ Spec::Runner.use orig_options
27
+ end
28
+ end
36
29
 
37
- before(:each) do
38
- create_dummy_spec_file
39
- @@drb_example_file_counter = @@drb_example_file_counter + 1
40
- end
30
+ before(:all) do
31
+ DRb.start_service("druby://127.0.0.1:8989", ::CommandLineForDrbSpec)
32
+ @@drb_example_file_counter = 0
33
+ end
41
34
 
42
- after(:each) do
43
- File.delete(@dummy_spec_filename)
44
- end
35
+ before(:each) do
36
+ create_dummy_spec_file
37
+ @@drb_example_file_counter = @@drb_example_file_counter + 1
38
+ end
45
39
 
46
- after(:all) do
47
- DRb.stop_service
48
- end
40
+ after(:each) do
41
+ File.delete(@dummy_spec_filename)
42
+ end
49
43
 
50
- it "should run against local server" do
51
- out = run_spec_via_druby(['--version'])
52
- out.should =~ /rspec \d+\.\d+\.\d+.*/n
53
- end
44
+ after(:all) do
45
+ DRb.stop_service
46
+ end
54
47
 
55
- it "should output green colorized text when running with --colour option" do
56
- out = run_spec_via_druby(["--colour", @dummy_spec_filename])
57
- out.should =~ /\e\[32m/n
58
- end
48
+ it "should run against local server" do
49
+ out = run_spec_via_druby(['--version'])
50
+ out.should =~ /rspec \d+\.\d+\.\d+.*/n
51
+ end
59
52
 
60
- it "should output red colorized text when running with -c option" do
61
- out = run_spec_via_druby(["-c", @dummy_spec_filename])
62
- out.should =~ /\e\[31m/n
63
- end
53
+ it "should output green colorized text when running with --colour option" do
54
+ out = run_spec_via_druby(["--colour", @dummy_spec_filename])
55
+ out.should =~ /\e\[32m/n
56
+ end
64
57
 
65
- def create_dummy_spec_file
66
- @dummy_spec_filename = File.expand_path(File.dirname(__FILE__)) + "/_dummy_spec#{@@drb_example_file_counter}.rb"
67
- File.open(@dummy_spec_filename, 'w') do |f|
68
- f.write %{
69
- describe "DUMMY CONTEXT for 'DrbCommandLine with -c option'" do
70
- it "should be output with green bar" do
71
- true.should be_true
72
- end
58
+ it "should output red colorized text when running with -c option" do
59
+ out = run_spec_via_druby(["-c", @dummy_spec_filename])
60
+ out.should =~ /\e\[31m/n
61
+ end
62
+
63
+ def create_dummy_spec_file
64
+ @dummy_spec_filename = File.expand_path(File.dirname(__FILE__)) + "/_dummy_spec#{@@drb_example_file_counter}.rb"
65
+ File.open(@dummy_spec_filename, 'w') do |f|
66
+ f.write %{
67
+ describe "DUMMY CONTEXT for 'DrbCommandLine with -c option'" do
68
+ it "should be output with green bar" do
69
+ true.should be_true
70
+ end
73
71
 
74
- it "should be output with red bar" do
75
- violated("I want to see a red bar!")
72
+ it "should be output with red bar" do
73
+ violated("I want to see a red bar!")
74
+ end
76
75
  end
77
- end
78
- }
76
+ }
77
+ end
79
78
  end
80
- end
81
79
 
82
- def run_spec_via_druby(argv)
83
- err, out = StringIO.new, StringIO.new
84
- out.instance_eval do
85
- def tty?; true end
80
+ def run_spec_via_druby(argv)
81
+ err, out = StringIO.new, StringIO.new
82
+ out.instance_eval do
83
+ def tty?; true end
84
+ end
85
+ options = ::Spec::Runner::Options.new(err, out)
86
+ options.argv = argv
87
+ Spec::Runner::DrbCommandLine.run(options)
88
+ out.rewind; out.read
86
89
  end
87
- options = ::Spec::Runner::Options.new(err, out)
88
- options.argv = argv
89
- Spec::Runner::DrbCommandLine.run(options)
90
- out.rewind; out.read
91
90
  end
91
+
92
92
  end
93
-
94
93
  end
95
-
96
94
  end
97
95
  end
@@ -23,6 +23,7 @@ module Spec
23
23
  @options = mock('options')
24
24
  @options.stub!(:dry_run).and_return(false)
25
25
  @options.stub!(:colour).and_return(false)
26
+ @options.stub!(:autospec).and_return(false)
26
27
  @formatter = Class.new(BaseTextFormatter) do
27
28
  def method_that_class_magenta(message)
28
29
  magenta(message)
@@ -67,7 +68,7 @@ module Spec
67
68
 
68
69
  it "colorizes when colour? and output_to_tty? return true" do
69
70
  out = StringIO.new
70
- options = stub('options', :colour => true)
71
+ options = stub('options', :colour => true, :autospec => false)
71
72
  formatter = BaseTextFormatter.new(options,out)
72
73
  formatter.stub!(:output_to_tty?).and_return(true)
73
74
  formatter.__send__(:colour, 'foo', "\e[32m").should == "\e[32mfoo\e[0m"
@@ -84,6 +85,15 @@ module Spec
84
85
  formatter.__send__(:colour, 'foo', "\e[32m").should == "\e[32mfoo\e[0m"
85
86
  end
86
87
 
88
+ it "colorizes when autospec? is true even if colour? and output_to_tty? return false" do
89
+ out = StringIO.new
90
+ options = stub('options', :colour => true, :autospec => true)
91
+ formatter = BaseTextFormatter.new(options,out)
92
+ formatter.stub!(:output_to_tty?).and_return(false)
93
+
94
+ formatter.__send__(:colour, 'foo', "\e[32m").should == "\e[32mfoo\e[0m"
95
+ end
96
+
87
97
  after(:each) do
88
98
  ENV['RSPEC_COLOR'] = @original_RSPEC_COLOR
89
99
  end
@@ -10,6 +10,7 @@ module Spec
10
10
  @io = StringIO.new
11
11
  options = mock('options')
12
12
  options.stub!(:colour).and_return(true)
13
+ options.stub!(:autospec).and_return(true)
13
14
  @formatter = ProfileFormatter.new(options, io)
14
15
  end
15
16
 
@@ -10,6 +10,7 @@ module Spec
10
10
  @options = mock('options')
11
11
  @options.stub!(:dry_run).and_return(false)
12
12
  @options.stub!(:colour).and_return(false)
13
+ @options.stub!(:autospec).and_return(false)
13
14
  @formatter = ProgressBarFormatter.new(@options, @io)
14
15
  end
15
16
 
@@ -405,4 +405,9 @@ describe "OptionParser" do
405
405
  options = parse(["--runner", "Custom::ExampleGroupRunner:something"])
406
406
  options.run_examples
407
407
  end
408
+
409
+ it "sets options.autospec to true with --autospec" do
410
+ options = parse(["--autospec"])
411
+ options.autospec.should be(true)
412
+ end
408
413
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dchelimsky-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.99.6
4
+ version: 1.1.99.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - RSpec Development Team
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-15 00:00:00 -08:00
12
+ date: 2009-02-18 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -167,6 +167,8 @@ files:
167
167
  - lib/spec/matchers.rb
168
168
  - lib/spec/matchers/be.rb
169
169
  - lib/spec/matchers/be_close.rb
170
+ - lib/spec/matchers/be_instance_of.rb
171
+ - lib/spec/matchers/be_kind_of.rb
170
172
  - lib/spec/matchers/change.rb
171
173
  - lib/spec/matchers/eql.rb
172
174
  - lib/spec/matchers/equal.rb
@@ -280,6 +282,8 @@ files:
280
282
  - spec/spec/interop/test/unit/testcase_spec.rb
281
283
  - spec/spec/interop/test/unit/testsuite_adapter_spec.rb
282
284
  - spec/spec/matchers/be_close_spec.rb
285
+ - spec/spec/matchers/be_instance_of_spec.rb
286
+ - spec/spec/matchers/be_kind_of_spec.rb
283
287
  - spec/spec/matchers/be_spec.rb
284
288
  - spec/spec/matchers/change_spec.rb
285
289
  - spec/spec/matchers/description_generation_spec.rb
@@ -412,6 +416,6 @@ rubyforge_project: rspec
412
416
  rubygems_version: 1.2.0
413
417
  signing_key:
414
418
  specification_version: 2
415
- summary: rspec 1.1.99.6
419
+ summary: rspec 1.1.99.7
416
420
  test_files: []
417
421