Switch branches/tags
Commits on Nov 1, 2013
  1. Merge pull request #1132 from rspec/hook-collection-hierarchy

    dchelimsky committed Nov 1, 2013
    Extract BaseHookCollection
  2. Extract BaseHookCollection

    dchelimsky committed Oct 20, 2013
    Previously the HookCollection was acting as a base with the subclasses
    overriding (some) methods. With this change, each subclass extends the
    base class by adding new methods, not overriding existing ones. Makes it
    all a bit easier to reason about.
Commits on Oct 5, 2013
  1. Merge pull request #1101 from rspec/refactor-hooks

    dchelimsky committed Oct 5, 2013
    Refactor hooks to reduce subclassing of Array and extending Proc objects at runtime.
  2. Refactor before, after, and around hooks.

    dchelimsky committed Oct 5, 2013
    * HookCollection classes wrap Arrays instead of subclassing Array
    * Procsy is a class instead of a module
      * no more extending a Proc w/ Procsy at runtime
    * Includes an interesting benchmark comparing passing proc
      around using `&block` vs `block`.
Commits on Sep 23, 2013
  1. align definitions of regexps and use File::SEPARATOR

    dchelimsky committed Sep 5, 2013
    NOTE: I didn't run this on Windows so I don't know if it actually
    passes on Windows yet.
  2. extract let

    dchelimsky committed Sep 5, 2013
  3. Display full backtrace when every line filtered.

    dchelimsky committed Sep 5, 2013
    Restores previous behavior and adds a message to the backtrace
    explaining that we're showing the full backtrace because every line was
  4. Move all backtrace filtering to one place

    dchelimsky committed Sep 5, 2013
    Backtrace filtering was ultimately managed by the BacktraceCleaner
    (now called BacktraceFormatter), but sometimes went through what
    was called the BacktraceFormatter. Specs for formatting backtraces
    were in a few different places.
    Now it's all managed by one object and all the specs are in one place.
    Leaves a temporary delegator to support rspec-expectations until that
    code is modified to use RSpec.configuration.backtrace_formatter instead
    of RSpec::Core::BacktraceFormatter.
    Also leaves an alias for Configuration#bactrace_cleaner. Need to decide
    whether to leave that in place or deprecate it in 2.99 w/ removal in
  5. merge exclusion patterns using Regexp.union

    dchelimsky committed Sep 4, 2013
    Per benchmarks, this is 2 to 3x faster.
  6. docstring improvements

    dchelimsky committed Sep 4, 2013
  7. remove spec_helper from default backtrace exclusions

    dchelimsky committed Sep 4, 2013
    Also moved examples for backtrace cleaner defaults to backtrace cleaner
    spec (from configuration spec).
  8. Clean up BacktraceCleaner

    dchelimsky committed Sep 3, 2013
    The global configuration object exposes exclusion_patterns,
    inclusion_patterns, and full_backtrace for modification at any time
    during a run. This means that it would be perfectly reasonable for a
    user to turn full_backtrace on and off around specific examples, and
    also change the content of each patterns array at any time.
    This commit does a number of things:
    * clarifies examples
    * decouples full_backtrace from exclusion_patterns
    * makes it so that setting full_backtrace true or false
      preserves the content of exclusion_patterns and inclusion_patterns.
    * simplifies the constructor
      * no args (no code outside examples submitted args to constructor)
    * simplifies default backtrace inclusion patterns
      * consistent default regardless of exclusion patterns
        * eliminates order dependency of assignments
        * does not conflict with behavior of keeping anything in working
          directory by default
    * simplifies the format_backtrace helper
      * collapses it into (effectively) piped iterators
      * see benchmarks/index_v_take_while.rb
Commits on Aug 31, 2013
  1. clean up warning for more than one arg to include_examples

    dchelimsky committed Aug 31, 2013
    * support warning for Ruby >= 1.9
    * use CallerFilter
    * improve wording of warning
Commits on Aug 29, 2013
  1. Warn arity mismatch on shared examples

    dchelimsky committed Aug 29, 2013
    * helps when users migrate from rspec-1 to rspec-2
    * see issue #1066
  2. Merge pull request #1045 from rspec/refactor-configuration-options

    dchelimsky committed Aug 29, 2013
    Refactor configuration options
  3. Refactor configuration_options

    dchelimsky committed Aug 29, 2013
    * simplify initialization of @Args
    * collapse option parsing procedure into single series of iterators
Commits on Aug 24, 2013
Commits on Aug 22, 2013
  1. Merge pull request #1057 from rspec/flat-map

    dchelimsky committed Aug 22, 2013
    Use flat_map {..} instead of map {..}.flatten
  2. Support flat_map

    dchelimsky committed Aug 22, 2013
    flat_map is over 40% faster for small arrays (see benchmarks), but is
    not available in Ruby-1.8.7. This commit adds an implementation for
    1.8.7 with a pass-through for >= 1.9.
    Hat tip to Myron Marston for the implementation that does not monkey
    patch nor extend runtime objects, and supports blocks without converting
    them to Procs.
Commits on Aug 15, 2013
  1. Define Hash subclasses for @inclusions and @exclusions

    dchelimsky committed Aug 15, 2013
    Building on changes from #1038, this clarifies the differences
    between the @inclusions and @exclusions hashes in FilterManager
    by introducing Hash subclasses with behavior appropriate to each.
  2. Merge pull request #1038 from kwstannard/refactor_of_exclusion/filter…

    dchelimsky committed Aug 15, 2013
    Refactor exclusion/filter rejection
Commits on Aug 10, 2013
  1. stop drb service in example

    dchelimsky committed Aug 10, 2013
    Fixes intermittent order-dependent failure:
      bin/rspec --seed 15528
      1151 examples, 1 failure, 1 pending
      Failed examples:
      rspec ./spec/rspec/core/configuration_spec.rb:393
      bin/rspec --seed 15528
      1151 examples, 0 failures, 1 pending
  2. simplify example

    dchelimsky committed Aug 10, 2013
  3. minor optimization

    dchelimsky committed Aug 10, 2013
    * Array(list) covers all necessary cases
        $ irb
        2.0.0p0 :001 > Array(nil)
         => []
        2.0.0p0 :002 > Array(:foo)
         => [:foo]
        2.0.0p0 :003 > Array([:foo,:bar])
         => [:foo, :bar]
    * Array(list) is considerably faster than list.flatten.compact
        $ time ruby -e "100000.times { [nil].flatten.compact; [:foo].flatten.compact; [[:foo, :bar]].flatten.compact }"
        real 0m0.465s
        user 0m0.461s
        sys  0m0.003s
        $ time ruby -e "100000.times { Array(nil); Array(:foo); Array([:foo, :bar]) }"
        real 0m0.117s
        user 0m0.113s
        sys  0m0.003s
Commits on Aug 8, 2013
Commits on Jun 26, 2013
Commits on Jun 19, 2013