Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ARGH... why do I get caught in the trappings of single quotes?

[git-p4: depot-paths = "//src/minitest/dev/": change = 8132]
  • Loading branch information...
commit fd7bb9ee437f6d7078e63cd966cab2cb1479c249 1 parent f40a26c
@zenspider zenspider authored
Showing with 29 additions and 29 deletions.
  1. +29 −29 test/minitest/test_minitest_spec.rb
View
58 test/minitest/test_minitest_spec.rb
@@ -1,6 +1,6 @@
# encoding: utf-8
-require 'minitest/autorun'
-require 'stringio'
+require "minitest/autorun"
+require "stringio"
class MiniSpecA < MiniTest::Spec; end
class MiniSpecB < MiniTest::Spec; end
@@ -8,7 +8,7 @@ class ExampleA; end
class ExampleB < ExampleA; end
describe MiniTest::Spec do
- # do not parallelize this suite... it just can't handle it.
+ # do not parallelize this suite... it just can"t handle it.

oops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
def assert_triggered expected = "blah", klass = MiniTest::Assertion
@assertion_count += 2
@@ -18,7 +18,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
end
msg = e.message.sub(/(---Backtrace---).*/m, '\1')
- msg.gsub!(/\(oid=[-0-9]+\)/, '(oid=N)')
+ msg.gsub!(/\(oid=[-0-9]+\)/, "(oid=N)")
assert_equal expected, msg
end
@@ -77,10 +77,10 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
it "needs to catch an unexpected exception" do
@assertion_count -= 2 # no positive
- msg = <<-EOM.gsub(/^ {6}/, '').chomp
+ msg = <<-EOM.gsub(/^ {6}/, "").chomp
[RuntimeError] exception expected, not
Class: <MiniTest::Assertion>
- Message: <\"MiniTest::Assertion\">
+ Message: <"MiniTest::Assertion">
---Backtrace---
EOM
@@ -133,7 +133,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
bad = %w[not raise throw send output be_silent]
- expected_wonts = expected_musts.map { |m| m.sub(/^must/, 'wont') }
+ expected_wonts = expected_musts.map { |m| m.sub(/^must/, "wont") }
expected_wonts.reject! { |m| m =~ /wont_#{Regexp.union(*bad)}/ }
musts.must_equal expected_musts
@@ -155,7 +155,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
it "needs to verify binary messages" do
42.wont_be(:<, 24).must_equal false
- assert_triggered 'Expected 24 to not be < 42.' do
+ assert_triggered "Expected 24 to not be < 42." do
24.wont_be :<, 42
end
@@ -191,17 +191,17 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
end
it "needs to verify floats outside a delta" do
- skip "float output is different in maglev" if maglev?
+ # skip "float output is different in maglev" if maglev?
@assertion_count += 1 # extra test
24.wont_be_close_to(42).must_equal false
- assert_triggered 'Expected |42 - 42.0| (0.0) to not be < 0.001.' do
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be < 0.001." do
(6 * 7.0).wont_be_close_to 42
end
- assert_triggered 'Expected |42 - 42.0| (0.0) to not be < 1.0e-05.' do
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be < 1.0e-05." do
(6 * 7.0).wont_be_close_to 42, 0.00001
end
@@ -211,17 +211,17 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
end
it "needs to verify floats outside an epsilon" do
- skip "float output is different in maglev" if maglev?
+ # skip "float output is different in maglev" if maglev?
@assertion_count += 1 # extra test
24.wont_be_within_epsilon(42).must_equal false
- assert_triggered 'Expected |42 - 42.0| (0.0) to not be < 0.042.' do
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be < 0.042." do
(6 * 7.0).wont_be_within_epsilon 42
end
- assert_triggered 'Expected |42 - 42.0| (0.0) to not be < 0.00042.' do
+ assert_triggered "Expected |42 - 42.0| (0.0) to not be < 0.00042." do
(6 * 7.0).wont_be_within_epsilon 42, 0.00001
end
@@ -231,17 +231,17 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
end
it "needs to verify floats within a delta" do
- skip "float output is different in maglev" if maglev?
+ # skip "float output is different in maglev" if maglev?
@assertion_count += 1 # extra test
(6.0 * 7).must_be_close_to(42.0).must_equal true
- assert_triggered 'Expected |0.0 - 0.01| (0.01) to be < 0.001.' do
+ assert_triggered "Expected |0.0 - 0.01| (0.01) to be < 0.001." do
(1.0 / 100).must_be_close_to 0.0
end
- assert_triggered 'Expected |0.0 - 0.001| (0.001) to be < 1.0e-06.' do
+ assert_triggered "Expected |0.0 - 0.001| (0.001) to be < 1.0e-06." do
(1.0 / 1000).must_be_close_to 0.0, 0.000001
end
@@ -255,11 +255,11 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
(6.0 * 7).must_be_within_epsilon(42.0).must_equal true
- assert_triggered 'Expected |0.0 - 0.01| (0.01) to be < 0.0.' do
+ assert_triggered "Expected |0.0 - 0.01| (0.01) to be < 0.0." do
(1.0 / 100).must_be_within_epsilon 0.0
end
- assert_triggered 'Expected |0.0 - 0.001| (0.001) to be < 0.0.' do
+ assert_triggered "Expected |0.0 - 0.001| (0.001) to be < 0.0." do
(1.0 / 1000).must_be_within_epsilon 0.0, 0.000001
end
@@ -295,7 +295,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
it "needs to verify instances of a class" do
42.wont_be_instance_of(String).must_equal false
- assert_triggered 'Expected 42 to not be an instance of Fixnum.' do
+ assert_triggered "Expected 42 to not be an instance of Fixnum." do
42.wont_be_instance_of Fixnum
end
@@ -307,7 +307,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
it "needs to verify kinds of a class" do
42.wont_be_kind_of(String).must_equal false
- assert_triggered 'Expected 42 to not be a kind of Integer.' do
+ assert_triggered "Expected 42 to not be a kind of Integer." do
42.wont_be_kind_of Integer
end
@@ -360,7 +360,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
it "needs to verify non-emptyness" do
@assertion_count += 3 # empty is 2 assertions
- ['some item'].wont_be_empty.must_equal false
+ ["some item"].wont_be_empty.must_equal false
assert_triggered "Expected [] to not be empty." do
[].wont_be_empty
@@ -398,7 +398,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
it "needs to verify objects not responding to a message" do
"".wont_respond_to(:woot!).must_equal false
- assert_triggered 'Expected "" to not respond to to_s.' do
+ assert_triggered "Expected \"\" to not respond to to_s." do
"".wont_respond_to :to_s
end
@@ -478,7 +478,7 @@ def assert_triggered expected = "blah", klass = MiniTest::Assertion
end
it "needs to verify using any (negative) predicate" do
- @assertion_count -= 1 # doesn't take a message
+ @assertion_count -= 1 # doesn"t take a message
"blah".wont_be(:empty?).must_equal false
@@ -699,7 +699,7 @@ def test_describe_first_structure
z = describe "second thingy" do end
end
- test_methods = ['test_0001_top level it', 'test_0002_не латинские буквы-и-спецсимволы&いった α, β, γ, δ, ε hello!!! world'].sort
+ test_methods = ["test_0001_top level it", "test_0002_не латинские буквы-и-спецсимволы&いった α, β, γ, δ, ε hello!!! world"].sort
assert_equal test_methods, [x1, x2]
assert_equal test_methods,
@@ -742,7 +742,7 @@ class TestSpecInTestCase < MetaMetaMetaTestCase
def setup
super
- @tc = MiniTest::Unit::TestCase.new 'fake tc'
+ @tc = MiniTest::Unit::TestCase.new "fake tc"
@assertion_count = 1
end
@@ -751,8 +751,8 @@ def util_assert_triggered expected, klass = MiniTest::Assertion # REFACTOR
yield
end
- msg = e.message.sub(/(---Backtrace---).*/m, '\1')
- msg.gsub!(/\(oid=[-0-9]+\)/, '(oid=N)')
+ msg = e.message.sub(/(---Backtrace---).*/m, "\1")
+ msg.gsub!(/\(oid=[-0-9]+\)/, "(oid=N)")
assert_equal expected, msg
end
@@ -776,7 +776,7 @@ def test_expectation_triggered
def test_expectation_with_a_message
util_assert_triggered "Expected: 2\n Actual: 1" do
- 1.must_equal 2, ''
+ 1.must_equal 2, ""
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.