Module: Spec

Defined in:
lib/spec/version.rb,
lib/spec/ruby.rb,
lib/spec/mocks.rb,
lib/spec/runner.rb,
lib/spec/example.rb,
lib/spec/dsl/main.rb,
lib/spec/matchers.rb,
lib/spec/test/unit.rb,
lib/spec/mocks/mock.rb,
lib/spec/deprecation.rb,
lib/spec/matchers/be.rb,
lib/spec/mocks/proxy.rb,
lib/spec/mocks/space.rb,
lib/spec/expectations.rb,
lib/spec/matchers/dsl.rb,
lib/spec/matchers/eql.rb,
lib/spec/matchers/has.rb,
lib/spec/mocks/errors.rb,
lib/spec/matchers/have.rb,
lib/spec/mocks/methods.rb,
lib/spec/rake/spectask.rb,
lib/spec/example/errors.rb,
lib/spec/matchers/equal.rb,
lib/spec/matchers/exist.rb,
lib/spec/matchers/match.rb,
lib/spec/runner/options.rb,
lib/spec/example/pending.rb,
lib/spec/example/subject.rb,
lib/spec/matchers/change.rb,
lib/spec/matchers/errors.rb,
lib/spec/matchers/pretty.rb,
lib/spec/runner/reporter.rb,
lib/spec/matchers/include.rb,
lib/spec/matchers/matcher.rb,
lib/spec/matchers/satisfy.rb,
lib/spec/matchers/be_close.rb,
lib/spec/mocks/order_group.rb,
lib/spec/expectations/errors.rb,
lib/spec/matchers/be_kind_of.rb,
lib/spec/matchers/respond_to.rb,
lib/spec/runner/command_line.rb,
lib/spec/expectations/handler.rb,
lib/spec/matchers/match_array.rb,
lib/spec/runner/configuration.rb,
lib/spec/runner/heckle_runner.rb,
lib/spec/runner/option_parser.rb,
lib/spec/example/example_group.rb,
lib/spec/example/example_proxy.rb,
lib/spec/matchers/throw_symbol.rb,
lib/spec/mocks/error_generator.rb,
lib/spec/mocks/example_methods.rb,
lib/spec/expectations/fail_with.rb,
lib/spec/runner/differs/default.rb,
lib/spec/example/example_matcher.rb,
lib/spec/example/example_methods.rb,
lib/spec/matchers/be_instance_of.rb,
lib/spec/matchers/method_missing.rb,
lib/spec/matchers/simple_matcher.rb,
lib/spec/mocks/argument_matchers.rb,
lib/spec/runner/drb_command_line.rb,
lib/spec/example/args_and_options.rb,
lib/spec/extensions/instance_exec.rb,
lib/spec/matchers/raise_exception.rb,
lib/spec/runner/backtrace_tweaker.rb,
lib/spec/runner/line_number_query.rb,
lib/spec/matchers/operator_matcher.rb,
lib/spec/matchers/wrap_expectation.rb,
lib/spec/mocks/message_expectation.rb,
lib/spec/example/predicate_matchers.rb,
lib/spec/mocks/argument_expectation.rb,
lib/spec/adapters/mock_frameworks/rr.rb,
lib/spec/example/example_group_proxy.rb,
lib/spec/runner/example_group_runner.rb,
lib/spec/example/module_reopening_fix.rb,
lib/spec/example/shared_example_group.rb,
lib/spec/example/example_group_factory.rb,
lib/spec/example/example_group_methods.rb,
lib/spec/adapters/mock_frameworks/mocha.rb,
lib/spec/adapters/mock_frameworks/rspec.rb,
lib/spec/example/before_and_after_hooks.rb,
lib/spec/example/example_group_hierarchy.rb,
lib/spec/matchers/generated_descriptions.rb,
lib/spec/runner/formatter/base_formatter.rb,
lib/spec/runner/formatter/html_formatter.rb,
lib/spec/runner/heckle_runner_unsupported.rb,
lib/spec/adapters/mock_frameworks/flexmock.rb,
lib/spec/runner/class_and_arguments_parser.rb,
lib/spec/runner/formatter/silent_formatter.rb,
lib/spec/runner/formatter/profile_formatter.rb,
lib/spec/runner/formatter/snippet_extractor.rb,
lib/spec/runner/formatter/specdoc_formatter.rb,
lib/spec/runner/formatter/base_text_formatter.rb,
lib/spec/runner/formatter/text_mate_formatter.rb,
lib/spec/runner/formatter/no_op_method_missing.rb,
lib/spec/runner/formatter/nested_text_formatter.rb,
lib/spec/runner/formatter/progress_bar_formatter.rb,
lib/spec/runner/formatter/failing_examples_formatter.rb,
lib/spec/runner/formatter/failing_example_groups_formatter.rb

Overview

Hack to stop active_support/dependencies from complaining about ‘spec/test/unit’ not defining Spec::Test::Unit

Defined Under Namespace

Modules: Adapters, DSL, Example, Expectations, Matchers, Mocks, Rake, Ruby, Runner, Test, VERSION Classes: HashWithDeprecationNotice

Class Method Summary collapse

Class Method Details

.deprecate(method, alternate_method = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/spec/deprecation.rb', line 3

def deprecate(method, alternate_method=nil)
  return if Spec::Runner.configuration.suppress_deprecation_warnings?
  message = <<-NOTICE

*****************************************************************
DEPRECATION WARNING: you are using deprecated behaviour that will
be removed from a future version of RSpec.

#{caller(0)[2]}

* #{method} is deprecated.
NOTICE
  if alternate_method
    message << <<-ADDITIONAL
* please use #{alternate_method} instead.
ADDITIONAL
  end

  message << "*****************************************************************"
  warn(message)
end

.warn(message) ⇒ Object



25
26
27
# File 'lib/spec/deprecation.rb', line 25

def warn(message)
  Kernel.warn(message)
end