Permalink
Browse files

some whitespace cleanup

  • Loading branch information...
dchelimsky committed May 27, 2009
1 parent 3510419 commit 67d8d8403b0f15d3fec07b86e549af4543211773
View
@@ -4,13 +4,13 @@
at.clear_mappings
# watch out: Ruby bug (1.8.6):
# %r(/) != /\//
- at.add_mapping(%r%^spec/.*_spec.rb$%) { |filename, _|
- filename
+ at.add_mapping(%r%^spec/.*_spec.rb$%) { |filename, _|
+ filename
}
- at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
+ at.add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
["spec/#{m[1]}_spec.rb"]
}
- at.add_mapping(%r%^spec/(spec_helper|shared/.*)\.rb$%) {
+ at.add_mapping(%r%^spec/(spec_helper|shared/.*)\.rb$%) {
at.files_matching %r%^spec/.*_spec\.rb$%
}
end
@@ -24,7 +24,7 @@ def initialize
self.failed_results_re = /^\d+\)\n(?:\e\[\d*m)?(?:.*?in )?'([^\n]*)'(?: FAILED)?(?:\e\[\d*m)?\n(.*?)\n\n/m
self.completed_re = /\n(?:\e\[\d*m)?\d* examples?/m
end
-
+
def consolidate_failures(failed)
filters = new_hash_of_arrays
failed.each do |spec, trace|
@@ -40,7 +40,7 @@ def make_test_cmd(files_to_test)
spec_program = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'bin', 'spec'))
return "#{ruby} #{spec_program} --autospec #{files_to_test.keys.flatten.join(' ')} #{add_options_if_present}"
end
-
+
def add_options_if_present # :nodoc:
File.exist?("spec/spec.opts") ? "-O spec/spec.opts " : ""
end
View
@@ -1,3 +1,3 @@
require 'spec'
-Spec::Runner.autorun
+Spec::Runner.autorun
View
@@ -16,15 +16,15 @@ def deprecate(method, alternate_method=nil)
* please use #{alternate_method} instead.
ADDITIONAL
end
-
+
message << "*****************************************************************"
warn(message)
end
-
+
def warn(message)
Kernel.warn(message)
end
-
+
end
class HashWithDeprecationNotice < Hash
View
@@ -1,2 +1 @@
require 'spec/dsl/main'
-
View
@@ -2,7 +2,7 @@ module Spec
module DSL
module Main
include Spec::Example::ArgsAndOptions
-
+
# Creates and returns a class that includes the ExampleGroupMethods
# module. Which ExampleGroup type is created depends on the directory of the file
# calling this method. For example, Spec::Rails will use different
@@ -28,7 +28,7 @@ def describe(*args, &block)
Spec::Example::ExampleGroupFactory.create_example_group(*args, &block)
end
alias :context :describe
-
+
# Creates an example group that can be shared by other example groups
#
# == Examples
@@ -39,7 +39,7 @@ def describe(*args, &block)
#
# describe SmallEdition do
# it_should_behave_like "All Editions"
- #
+ #
# it "should do small edition stuff" do
# ...
# end
@@ -50,7 +50,7 @@ def share_examples_for(*args, &block)
Spec::Example::ExampleGroupFactory.create_shared_example_group(*args, &block)
end
alias :shared_examples_for :share_examples_for
-
+
# Creates a Shared Example Group and assigns it to a constant
#
# share_as :AllEditions do
@@ -59,7 +59,7 @@ def share_examples_for(*args, &block)
#
# describe SmallEdition do
# it_should_behave_like AllEditions
- #
+ #
# it "should do small edition stuff" do
# ...
# end
@@ -70,7 +70,7 @@ def share_examples_for(*args, &block)
#
# describe SmallEdition do
# include AllEditions
- #
+ #
# it "should do small edition stuff" do
# ...
# end
View
@@ -7,102 +7,102 @@ module Spec
# An Example Group is a group of code examples.
#
# RSpec exposes a DSL to describe groups of examples.
- #
+ #
# describe Account do
# it "should have a balance of $0" do
# account = Account.new
# account.balance.should == Money.new(0, :dollars)
# end
# end
- #
+ #
# == Before and After
- #
+ #
# You can use the <tt>before()</tt> and <tt>after()</tt> methods to extract
# common code within an Example Group. Both methods take an optional scope
# argument so you can run the block before :each example or before :all
# examples
- #
+ #
# describe "..." do
# before :all do
# ...
# end
- #
+ #
# before :each do
# ...
# end
- #
+ #
# it "should do something" do
# ...
# end
- #
+ #
# it "should do something else" do
# ...
# end
- #
+ #
# after :each do
# ...
# end
- #
+ #
# after :all do
# ...
# end
- #
+ #
# end
- #
+ #
# The <tt>before :each</tt> block will run before each of the examples, once
# for each example. Likewise, the <tt>after :each</tt> block will run after
# each of the examples.
- #
+ #
# It is also possible to specify a <tt>before :all</tt> and <tt>after
# :all</tt> block that will run only once for each example group, before the
# first <code>before :each</code> and after the last <code>after
# :each</code> respectively. The use of these is generally discouraged,
# because it introduces dependencies between the examples. Still, it might
# prove useful for very expensive operations if you know what you are doing.
- #
+ #
# == Local helper methods
- #
+ #
# You can include local helper methods by simply expressing them within an
# example group:
- #
+ #
# describe "..." do
- #
+ #
# it "..." do
# helper_method
# end
- #
+ #
# def helper_method
# ...
# end
- #
+ #
# end
- #
+ #
# == Included helper methods
- #
+ #
# You can include helper methods in multiple example groups by expressing
# them within a module, and then including that module in your example
# groups:
- #
+ #
# module AccountExampleHelperMethods
# def helper_method
# ...
# end
# end
- #
+ #
# describe "A new account" do
# include AccountExampleHelperMethods
# before do
# @account = Account.new
# end
- #
+ #
# it "should have a balance of $0" do
# helper_method
# @account.balance.should eql(Money.new(0, :dollars))
# end
# end
- #
+ #
# == Shared Example Groups
- #
+ #
# You can define a shared example group, that may be used on other groups
#
# share_examples_for "All Editions" do
@@ -111,7 +111,7 @@ module Spec
#
# describe SmallEdition do
# it_should_behave_like "All Editions"
- #
+ #
# it "should do small edition stuff" do
# ...
# end
@@ -125,7 +125,7 @@ module Spec
#
# describe SmallEdition do
# it_should_behave_like AllEditions
- #
+ #
# it "should do small edition stuff" do
# ...
# end
@@ -136,7 +136,7 @@ module Spec
#
# describe SmallEdition do
# include AllEditions
- #
+ #
# it "should do small edition stuff" do
# ...
# end
@@ -162,4 +162,3 @@ module Example
require 'spec/example/example_group_factory'
require 'spec/example/errors'
require 'spec/example/example_matcher'
-
@@ -12,7 +12,7 @@ def add_options(args, options={}) # :nodoc:
args.options.merge!(options)
args.options
end
-
+
def set_location(options, location) # :nodoc:
options[:location] ||= location
end
@@ -5,12 +5,12 @@ class << self
def before_suite_parts # :nodoc:
@before_suite_parts ||= []
end
-
+
def after_suite_parts # :nodoc:
@after_suite_parts ||= []
end
end
-
+
# Registers a block to be executed before examples. <tt>scope</tt> can be
# <tt>:each</tt> (default), <tt>:all</tt>, or <tt>:suite</tt>. When
# <tt>:each</tt>, the block is executed before each example. When
@@ -23,15 +23,15 @@ def append_before(scope = :each, &block)
# Registers a block to be executed before each example.
# This method prepends +block+ to existing before blocks.
- #
+ #
# See <tt>append_before</tt> for scoping semantics.
def prepend_before(scope = :each, &block)
before_parts(scope).unshift(block)
end
# Registers a block to be executed after each example.
# This method prepends +block+ to existing after blocks.
- #
+ #
# See <tt>append_before</tt> for scoping semantics.
def prepend_after(scope = :each, &block)
after_parts(scope).unshift(block)
@@ -40,7 +40,7 @@ def prepend_after(scope = :each, &block)
# Registers a block to be executed after each example.
# This method appends +block+ to existing after blocks.
- #
+ #
# See <tt>append_before</tt> for scoping semantics.
def append_after(scope = :each, &block)
after_parts(scope) << block
@@ -53,7 +53,7 @@ def before_each_parts # :nodoc:
def after_each_parts # :nodoc:
@after_each_parts ||= []
end
-
+
def before_all_parts # :nodoc:
@before_all_parts ||= []
end
@@ -65,13 +65,13 @@ def after_all_parts # :nodoc:
def before_suite_parts # :nodoc:
BeforeAndAfterHooks.before_suite_parts
end
-
+
def after_suite_parts # :nodoc:
BeforeAndAfterHooks.after_suite_parts
end
-
+
private
-
+
def before_parts(scope)
case scope
when :each; before_each_parts
@@ -90,4 +90,4 @@ def after_parts(scope)
end
end
-end
+end
@@ -1,7 +1,7 @@
module Spec
module Example
class ExamplePendingError < StandardError; end
-
+
class NotYetImplementedError < ExamplePendingError
MESSAGE = "Not Yet Implemented"
def initialize
@@ -10,7 +10,7 @@ def initialize
end
class PendingExampleFixedError < StandardError; end
-
+
class NoDescriptionError < ArgumentError
def initialize(kind, location)
super("No description supplied for #{kind} declared on #{location}")
@@ -8,4 +8,3 @@ class ExampleGroup
end
end
end
-
Oops, something went wrong.

0 comments on commit 67d8d84

Please sign in to comment.