Permalink
Browse files

whitespace cleanup

  • Loading branch information...
1 parent 138e8ad commit bd2afb3c5cea105473e8bc1017a0bf717dbc890b @JonRowe JonRowe committed Mar 21, 2013
@@ -16,7 +16,7 @@
# 0.000000 0.010000 8.800000 ( 8.906383)
# 0.010000 0.010000 8.880000 ( 8.980907)
# 0.000000 0.010000 8.820000 ( 8.918083)
-#
+#
# After autoloading matcher class files
# 0.000000 0.010000 8.610000 ( 8.701434)
# 0.010000 0.010000 8.620000 ( 8.741811)
@@ -28,7 +28,7 @@ module Bar; end
end
end
-# $ ruby benchmarks/include_v_superclass.rb
+# $ ruby benchmarks/include_v_superclass.rb
# Class.new(Foo)
# 0.030000 0.000000 0.030000 ( 0.033536)
# 0.020000 0.000000 0.020000 ( 0.022077)
@@ -69,112 +69,112 @@
# 0.340000 0.000000 0.340000 ( 0.342052)
# 0.330000 0.010000 0.340000 ( 0.340618)
# 0.340000 0.000000 0.340000 ( 0.339149)
-#
+#
# * using a class
# 0.000000 0.000000 0.000000 ( 0.003762)
# 0.010000 0.000000 0.010000 ( 0.004192)
# 0.000000 0.000000 0.000000 ( 0.003791)
-#
+#
# failing examples: 5.should eq(3)
# * using the DSL
# 0.380000 0.000000 0.380000 ( 0.384415)
# 0.380000 0.010000 0.390000 ( 0.381604)
# 0.370000 0.000000 0.370000 ( 0.380255)
-#
+#
# * using a class
# 0.040000 0.000000 0.040000 ( 0.034528)
# 0.030000 0.000000 0.030000 ( 0.032021)
# 0.060000 0.010000 0.070000 ( 0.067579)
-#
+#
# 3 runs of 1000 times for each example running ruby/1.9.2
# passing examples: 5.should eq(5)
# * using the DSL
# 0.250000 0.010000 0.260000 ( 0.249692)
# 0.250000 0.000000 0.250000 ( 0.253856)
# 0.230000 0.000000 0.230000 ( 0.232787)
-#
+#
# * using a class
# 0.000000 0.000000 0.000000 ( 0.001069)
# 0.000000 0.000000 0.000000 ( 0.001041)
# 0.000000 0.000000 0.000000 ( 0.001023)
-#
+#
# failing examples: 5.should eq(3)
# * using the DSL
# 0.370000 0.000000 0.370000 ( 0.377139)
# 0.360000 0.010000 0.370000 ( 0.358379)
# 0.370000 0.000000 0.370000 ( 0.373795)
-#
+#
# * using a class
# 0.060000 0.010000 0.070000 ( 0.073325)
# 0.050000 0.000000 0.050000 ( 0.053562)
# 0.070000 0.000000 0.070000 ( 0.075382)
-#
+#
# 3 runs of 1000 times for each example running ruby/1.9.3
# passing examples: 5.should eq(5)
# * using the DSL
# 0.210000 0.000000 0.210000 ( 0.219539)
# 0.220000 0.010000 0.230000 ( 0.217905)
# 0.220000 0.000000 0.220000 ( 0.219657)
-#
+#
# * using a class
# 0.000000 0.000000 0.000000 ( 0.001054)
# 0.000000 0.000000 0.000000 ( 0.001048)
# 0.000000 0.000000 0.000000 ( 0.001035)
-#
+#
# failing examples: 5.should eq(3)
# * using the DSL
# 0.350000 0.000000 0.350000 ( 0.351742)
# 0.360000 0.000000 0.360000 ( 0.362456)
# 0.340000 0.010000 0.350000 ( 0.351098)
-#
+#
# * using a class
# 0.080000 0.000000 0.080000 ( 0.079964)
# 0.080000 0.000000 0.080000 ( 0.076579)
# 0.070000 0.000000 0.070000 ( 0.080587)
-#
+#
# 3 runs of 1000 times for each example running rbx/1.8.7
# passing examples: 5.should eq(5)
# * using the DSL
# 1.926107 0.009784 1.935891 ( 1.629354)
# 0.583860 0.004390 0.588250 ( 0.580396)
# 0.868571 0.003510 0.872081 ( 0.796644)
-#
+#
# * using a class
# 0.002652 0.000013 0.002665 ( 0.002679)
# 0.001845 0.000016 0.001861 ( 0.001848)
# 0.002656 0.000010 0.002666 ( 0.001823)
-#
+#
# failing examples: 5.should eq(3)
# * using the DSL
# 0.694148 0.002006 0.696154 ( 0.648551)
# 1.063773 0.004653 1.068426 ( 0.998837)
# 0.643594 0.001356 0.644950 ( 0.638358)
-#
+#
# * using a class
# 0.020139 0.000036 0.020175 ( 0.020161)
# 0.097540 0.000575 0.098115 ( 0.084680)
# 0.058366 0.000269 0.058635 ( 0.044372)
-#
+#
# 3 runs of 1000 times for each example running jruby/1.8.7
# passing examples: 5.should eq(5)
# * using the DSL
# 0.355000 0.000000 0.355000 ( 0.355000)
# 0.261000 0.000000 0.261000 ( 0.261000)
# 0.242000 0.000000 0.242000 ( 0.242000)
-#
+#
# * using a class
# 0.007000 0.000000 0.007000 ( 0.007000)
# 0.004000 0.000000 0.004000 ( 0.004000)
# 0.001000 0.000000 0.001000 ( 0.001000)
-#
+#
# failing examples: 5.should eq(3)
# * using the DSL
# 0.507000 0.000000 0.507000 ( 0.507000)
# 0.468000 0.000000 0.468000 ( 0.468000)
# 0.476000 0.000000 0.476000 ( 0.476000)
-#
+#
# * using a class
# 0.259000 0.000000 0.259000 ( 0.259000)
# 0.521000 0.000000 0.521000 ( 0.521000)
# 0.244000 0.000000 0.244000 ( 0.244000)
-#
+#
@@ -36,7 +36,7 @@
end
end
-# Positive examples:
+# Positive examples:
# user system total real
# set.include?(item 0) 2.000000 0.010000 2.010000 ( 1.999305)
# array.include?(item 0) 1.170000 0.000000 1.170000 ( 1.173168)
@@ -61,7 +61,7 @@
# ================================================================================
-# Negative examples:
+# Negative examples:
# user system total real
# set 1.940000 0.000000 1.940000 ( 1.941780)
# array 4.240000 0.010000 4.250000 ( 4.238137)
@@ -9,7 +9,7 @@ can be used with `should` or `should_not` e.g.
## Object identity
actual.should be(expected) # passes if actual.equal?(expected)
-
+
## Object equivalence
actual.should eq(expected) # passes if actual == expected
@@ -4,11 +4,11 @@ Feature: be_within matcher
Consider this irb session:
> radius = 3
- => 3
+ => 3
> area_of_circle = radius * radius * Math::PI
- => 28.2743338823081
+ => 28.2743338823081
> area_of_circle == 28.2743338823081
- => false
+ => false
Instead, you should use the be_within matcher to check that the value
is within a delta of your expected value:
@@ -11,14 +11,14 @@ Feature: expect change
@count ||= 0
@count += 1
end
-
+
def count
@count ||= 0
end
end
end
"""
-
+
Scenario: expect change
Given a file named "spec/example_spec.rb" with:
"""ruby
@@ -1,6 +1,6 @@
Feature: start_with matcher
- Use the `start_with` matcher to specify that a string or array starts with
+ Use the `start_with` matcher to specify that a string or array starts with
the expected characters or elements.
```ruby
@@ -12,7 +12,7 @@ Feature: define diffable matcher
match do |actual|
actual == expected
end
-
+
diffable
end
@@ -9,30 +9,30 @@ Feature: define matcher outside rspec
"""ruby
require "rspec/expectations"
require "test/unit"
-
+
RSpec::Matchers.define :be_a_multiple_of do |expected|
match do |actual|
actual % expected == 0
end
end
-
+
class Test::Unit::TestCase
include RSpec::Matchers
end
-
+
class TestMultiples < Test::Unit::TestCase
-
+
def test_9_should_be_a_multiple_of_3
9.should be_a_multiple_of(3)
end
def test_9_should_be_a_multiple_of_4
9.should be_a_multiple_of(4)
end
-
+
end
"""
When I run `ruby test_multiples.rb`
- Then the exit status should not be 0
+ Then the exit status should not be 0
And the output should contain "expected 9 to be a multiple of 4"
And the output should contain "2 tests, 0 assertions, 0 failures, 1 errors"
@@ -1,7 +1,7 @@
Feature: define matcher with fluent interface
Use the chain() method to define matchers with a fluent interface.
-
+
Scenario: chained method with argumetn
Given a file named "between_spec.rb" with:
"""ruby
@@ -3,7 +3,7 @@ Feature: customized message
RSpec tries to provide useful failure messages, but for cases in which you
want more specific information, you can define your own message right in the
example. This works for any matcher _other than the operator matchers_.
-
+
Scenario: customize failure message
Given a file named "example_spec.rb" with:
"""ruby
@@ -37,7 +37,7 @@ module RSpec
# `eq.failure_message_for_should_not`.
#
# rspec-expectations ships with a standard set of useful matchers, and writing
- # your own matchers is quite simple.
+ # your own matchers is quite simple.
#
# See [RSpec::Matchers](../RSpec/Matchers) for more information about the
# built-in matchers that ship with rspec-expectations, and how to write your
@@ -91,7 +91,7 @@ def __delegate_operator(actual, operator, expected)
if actual.__send__(operator, expected)
true
elsif ['==','===', '=~'].include?(operator)
- fail_with_message("expected: #{expected.inspect}\n got: #{actual.inspect} (using #{operator})")
+ fail_with_message("expected: #{expected.inspect}\n got: #{actual.inspect} (using #{operator})")
else
fail_with_message("expected: #{operator} #{expected.inspect}\n got: #{operator.gsub(/./, ' ')} #{actual.inspect}")
end

0 comments on commit bd2afb3

Please sign in to comment.