mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 22:45:03 +02:00
* remove trailing spaces, append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
95e8c48dd3
commit
6bc742bc6d
30 changed files with 37 additions and 31 deletions
|
@ -17,4 +17,4 @@ class Object
|
||||||
def be_false
|
def be_false
|
||||||
BeFalseMatcher.new
|
BeFalseMatcher.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,4 +17,4 @@ class Object
|
||||||
def be_nil
|
def be_nil
|
||||||
BeNilMatcher.new
|
BeNilMatcher.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,4 +17,4 @@ class Object
|
||||||
def be_true
|
def be_true
|
||||||
BeTrueMatcher.new
|
BeTrueMatcher.new
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -75,4 +75,4 @@ class Object
|
||||||
def equal_element(*args)
|
def equal_element(*args)
|
||||||
EqualElementMatcher.new(*args)
|
EqualElementMatcher.new(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,4 +9,4 @@ class Object
|
||||||
def have_class_variable(variable)
|
def have_class_variable(variable)
|
||||||
HaveClassVariableMatcher.new(variable)
|
HaveClassVariableMatcher.new(variable)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,4 +9,4 @@ class Object
|
||||||
def have_instance_variable(variable)
|
def have_instance_variable(variable)
|
||||||
HaveInstanceVariableMatcher.new(variable)
|
HaveInstanceVariableMatcher.new(variable)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -65,7 +65,7 @@ Finished in 2.0 seconds
|
||||||
|
|
||||||
1)
|
1)
|
||||||
describe it ERROR
|
describe it ERROR
|
||||||
Exception: broken:
|
Exception: broken:
|
||||||
path/to/some/file.rb:35:in method
|
path/to/some/file.rb:35:in method
|
||||||
|
|
||||||
1 example, 0 failures
|
1 example, 0 failures
|
||||||
|
|
|
@ -9,7 +9,7 @@ describe MSpec, "#deprecate" do
|
||||||
warning.should start_with(<<-EOS.chomp)
|
warning.should start_with(<<-EOS.chomp)
|
||||||
|
|
||||||
some_method is deprecated, use other_method instead.
|
some_method is deprecated, use other_method instead.
|
||||||
from
|
from
|
||||||
EOS
|
EOS
|
||||||
warning.should include(__FILE__)
|
warning.should include(__FILE__)
|
||||||
warning.should include('8')
|
warning.should include('8')
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
f {
|
f {
|
||||||
|
|
|
@ -8,4 +8,4 @@ describe "Complex#negative?" do
|
||||||
c.negative?
|
c.negative?
|
||||||
}.should raise_error(NoMethodError)
|
}.should raise_error(NoMethodError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,4 +8,4 @@ describe "Complex#positive?" do
|
||||||
c.positive?
|
c.positive?
|
||||||
}.should raise_error(NoMethodError)
|
}.should raise_error(NoMethodError)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -68,7 +68,7 @@ with_feature :encoding do
|
||||||
str = "あ"
|
str = "あ"
|
||||||
str.force_encoding("ascii-8bit")
|
str.force_encoding("ascii-8bit")
|
||||||
encoded = str.encode("utf-8", "utf-8")
|
encoded = str.encode("utf-8", "utf-8")
|
||||||
|
|
||||||
encoded.should_not equal(str)
|
encoded.should_not equal(str)
|
||||||
encoded.encoding.should == Encoding::UTF_8
|
encoded.encoding.should == Encoding::UTF_8
|
||||||
end
|
end
|
||||||
|
|
|
@ -477,7 +477,7 @@ module Super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module KeywordArguments
|
module KeywordArguments
|
||||||
class A
|
class A
|
||||||
def foo(**args)
|
def foo(**args)
|
||||||
|
|
|
@ -232,7 +232,7 @@ describe "The rescue keyword" do
|
||||||
end
|
end
|
||||||
end.should raise_error(Exception)
|
end.should raise_error(Exception)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "uses === to compare against rescued classes" do
|
it "uses === to compare against rescued classes" do
|
||||||
rescuer = Class.new
|
rescuer = Class.new
|
||||||
|
|
||||||
|
@ -245,12 +245,12 @@ describe "The rescue keyword" do
|
||||||
rescue rescuer
|
rescue rescuer
|
||||||
rescued = :success
|
rescued = :success
|
||||||
rescue Exception
|
rescue Exception
|
||||||
rescued = :failure
|
rescued = :failure
|
||||||
end
|
end
|
||||||
|
|
||||||
rescued.should == :success
|
rescued.should == :success
|
||||||
end
|
end
|
||||||
|
|
||||||
it "only accepts Module or Class in rescue clauses" do
|
it "only accepts Module or Class in rescue clauses" do
|
||||||
rescuer = 42
|
rescuer = 42
|
||||||
lambda {
|
lambda {
|
||||||
|
|
|
@ -246,7 +246,7 @@ describe "The super keyword" do
|
||||||
it "without explicit arguments that are '_' including any modifications" do
|
it "without explicit arguments that are '_' including any modifications" do
|
||||||
Super::ZSuperWithUnderscores::B.new.m_modified(1, 2).should == [14, 2]
|
Super::ZSuperWithUnderscores::B.new.m_modified(1, 2).should == [14, 2]
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when using keyword arguments' do
|
describe 'when using keyword arguments' do
|
||||||
it 'passes any given keyword arguments to the parent' do
|
it 'passes any given keyword arguments to the parent' do
|
||||||
b = Super::KeywordArguments::B.new
|
b = Super::KeywordArguments::B.new
|
||||||
|
|
|
@ -29,7 +29,7 @@ describe "The undef keyword" do
|
||||||
it "raises a NameError when passed a missing name" do
|
it "raises a NameError when passed a missing name" do
|
||||||
Class.new do
|
Class.new do
|
||||||
lambda {
|
lambda {
|
||||||
undef not_exist
|
undef not_exist
|
||||||
}.should raise_error(NameError) { |e|
|
}.should raise_error(NameError) { |e|
|
||||||
# a NameError and not a NoMethodError
|
# a NameError and not a NoMethodError
|
||||||
e.class.should == NameError
|
e.class.should == NameError
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe "Base64#urlsafe_decode64" do
|
||||||
|
|
||||||
it "uses '-' instead of '+'" do
|
it "uses '-' instead of '+'" do
|
||||||
decoded = Base64.urlsafe_decode64('IkJlaW5nIGRpc2ludGVncmF0ZWQgbWFrZXMgbWUgdmUtcnkgYW4tZ3J5ISIgPGh1ZmYsIGh1ZmY-')
|
decoded = Base64.urlsafe_decode64('IkJlaW5nIGRpc2ludGVncmF0ZWQgbWFrZXMgbWUgdmUtcnkgYW4tZ3J5ISIgPGh1ZmYsIGh1ZmY-')
|
||||||
decoded.should == '"Being disintegrated makes me ve-ry an-gry!" <huff, huff>'
|
decoded.should == '"Being disintegrated makes me ve-ry an-gry!" <huff, huff>'
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_is ""..."2.3" do
|
ruby_version_is ""..."2.3" do
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
This is an example file
|
This is an example file
|
||||||
which is going to be transmitted
|
which is going to be transmitted
|
||||||
using #putbinaryfile.
|
using #putbinaryfile.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
This is an example file
|
This is an example file
|
||||||
which is going to be transmitted
|
which is going to be transmitted
|
||||||
using #puttextfile.
|
using #puttextfile.
|
||||||
|
|
|
@ -45,4 +45,4 @@ describe "TCPSocket#setsockopt" do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe "Thread::SizedQueue#max=" do
|
||||||
@sized_queue.max = 10
|
@sized_queue.max = 10
|
||||||
@sized_queue.max.should == 10
|
@sized_queue.max.should == 10
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not remove items already in the queue beyond the maximum" do
|
it "does not remove items already in the queue beyond the maximum" do
|
||||||
@sized_queue.enq 1
|
@sized_queue.enq 1
|
||||||
@sized_queue.enq 2
|
@sized_queue.enq 2
|
||||||
|
|
|
@ -154,7 +154,7 @@ VALUE sws_typed_change_struct(VALUE self, VALUE obj, VALUE new_val) {
|
||||||
void Init_typed_data_spec(void) {
|
void Init_typed_data_spec(void) {
|
||||||
VALUE cls;
|
VALUE cls;
|
||||||
cls = rb_define_class("CApiAllocTypedSpecs", rb_cObject);
|
cls = rb_define_class("CApiAllocTypedSpecs", rb_cObject);
|
||||||
|
|
||||||
#if defined(HAVE_RTYPEDDATA) && defined(HAVE_TYPEDDATA_WRAP_STRUCT)
|
#if defined(HAVE_RTYPEDDATA) && defined(HAVE_TYPEDDATA_WRAP_STRUCT)
|
||||||
rb_define_alloc_func(cls, sdaf_alloc_typed_func);
|
rb_define_alloc_func(cls, sdaf_alloc_typed_func);
|
||||||
rb_define_method(cls, "typed_wrapped_data", sdaf_typed_get_struct, 0);
|
rb_define_method(cls, "typed_wrapped_data", sdaf_typed_get_struct, 0);
|
||||||
|
|
|
@ -3,17 +3,17 @@ require File.expand_path('../../spec_helper', __FILE__)
|
||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
describe "String#to_f" do
|
describe "String#to_f" do
|
||||||
|
|
||||||
it "resists CVE-2013-4164 by converting very long Strings to a Float" do
|
it "resists CVE-2013-4164 by converting very long Strings to a Float" do
|
||||||
"1.#{'1'*1000000}".to_f.should be_close(1.1111111111111112, TOLERANCE)
|
"1.#{'1'*1000000}".to_f.should be_close(1.1111111111111112, TOLERANCE)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "JSON.parse" do
|
describe "JSON.parse" do
|
||||||
|
|
||||||
it "resists CVE-2013-4164 by converting very long Strings to a Float" do
|
it "resists CVE-2013-4164 by converting very long Strings to a Float" do
|
||||||
JSON.parse("[1.#{'1'*1000000}]").first.should be_close(1.1111111111111112, TOLERANCE)
|
JSON.parse("[1.#{'1'*1000000}]").first.should be_close(1.1111111111111112, TOLERANCE)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ require File.expand_path('../../spec_helper', __FILE__)
|
||||||
require 'rexml/document'
|
require 'rexml/document'
|
||||||
|
|
||||||
describe "REXML::Document.new" do
|
describe "REXML::Document.new" do
|
||||||
|
|
||||||
it "resists CVE-2014-8080 by raising an exception when entity expansion has grown too large" do
|
it "resists CVE-2014-8080 by raising an exception when entity expansion has grown too large" do
|
||||||
xml = <<XML
|
xml = <<XML
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
@ -28,5 +28,5 @@ XML
|
||||||
e.message.should =~ /entity expansion has grown too large/
|
e.message.should =~ /entity expansion has grown too large/
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue