summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/clone_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/clone_spec.rb')
-rw-r--r--spec/ruby/core/array/clone_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/ruby/core/array/clone_spec.rb b/spec/ruby/core/array/clone_spec.rb
new file mode 100644
index 0000000000..7ce9d40a81
--- /dev/null
+++ b/spec/ruby/core/array/clone_spec.rb
@@ -0,0 +1,31 @@
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
+require_relative 'shared/clone'
+
+describe "Array#clone" do
+ it_behaves_like :array_clone, :clone
+
+ it "copies frozen status from the original" do
+ a = [1, 2, 3, 4]
+ b = [1, 2, 3, 4]
+ a.freeze
+ aa = a.clone
+ bb = b.clone
+
+ aa.should.frozen?
+ bb.should_not.frozen?
+ end
+
+ it "copies singleton methods" do
+ a = [1, 2, 3, 4]
+ b = [1, 2, 3, 4]
+ def a.a_singleton_method; end
+ aa = a.clone
+ bb = b.clone
+
+ a.respond_to?(:a_singleton_method).should == true
+ b.respond_to?(:a_singleton_method).should == false
+ aa.respond_to?(:a_singleton_method).should == true
+ bb.respond_to?(:a_singleton_method).should == false
+ end
+end
>29
-rw-r--r--error.c12
-rw-r--r--eval.c17
-rw-r--r--ext/Win32API/Win32API.c2
-rw-r--r--ext/dl/ptr.c5
-rw-r--r--ext/dl/sym.c2
-rw-r--r--ext/extmk.rb70
-rw-r--r--ext/openssl/lib/net/ftptls.rb10
-rw-r--r--ext/openssl/lib/net/telnets.rb3
-rw-r--r--ext/openssl/lib/openssl/ssl.rb2
-rw-r--r--ext/openssl/ossl.h1
-rw-r--r--ext/openssl/ossl_config.c5
-rw-r--r--ext/openssl/ossl_pkcs5.h6
-rw-r--r--ext/openssl/ossl_x509name.c4
-rw-r--r--ext/pty/pty.c5
-rw-r--r--ext/sdbm/_sdbm.c2
-rw-r--r--ext/socket/getnameinfo.c5
-rw-r--r--ext/socket/socket.c19
-rw-r--r--ext/stringio/stringio.c20
-rw-r--r--ext/syck/syck.h2
-rw-r--r--ext/tk/tcltklib.c11
-rw-r--r--ext/win32ole/win32ole.c38
-rw-r--r--file.c251
-rw-r--r--gc.c45
-rw-r--r--hash.c61
-rw-r--r--intern.h1
-rw-r--r--io.c5
-rw-r--r--lib/README2
-rw-r--r--lib/base64.rb2
-rw-r--r--lib/mkmf.rb14
-rw-r--r--lib/net/http.rb3
-rw-r--r--lib/net/imap.rb1
-rw-r--r--lib/net/telnet.rb2
-rw-r--r--lib/open-uri.rb10
-rw-r--r--lib/optparse.rb2
-rw-r--r--lib/rdoc/options.rb4
-rw-r--r--lib/rexml/encodings/CP-1252.rb110
-rw-r--r--lib/rexml/encodings/ISO-8859-15.rb50
-rw-r--r--lib/rexml/encodings/SHIFT-JIS.rb4
-rw-r--r--lib/rexml/source.rb2
-rw-r--r--lib/rinda/tuplespace.rb13
-rw-r--r--lib/webrick/httpservlet/abstract.rb2
-rw-r--r--lib/webrick/httpservlet/cgi_runner.rb4
-rw-r--r--lib/webrick/httpservlet/filehandler.rb71
-rw-r--r--lib/xmlrpc/client.rb7
-rw-r--r--lib/xmlrpc/parser.rb4
-rw-r--r--lib/xmlrpc/utils.rb2
-rw-r--r--marshal.c4
-rw-r--r--missing/strftime.c2
-rw-r--r--numeric.c131
-rw-r--r--parse.y29
-rw-r--r--process.c100
-rw-r--r--range.c5
-rw-r--r--regex.c37
-rw-r--r--ruby.c204
-rw-r--r--sample/test.rb5
-rw-r--r--sprintf.c65
-rw-r--r--string.c2
-rw-r--r--struct.c7
-rw-r--r--test/rinda/test_rinda.rb14
-rw-r--r--test/ruby/test_hash.rb564
-rw-r--r--test/ruby/test_marshal.rb20
-rw-r--r--test/ruby/test_system.rb5
-rw-r--r--test/webrick/.htaccess1
-rw-r--r--test/webrick/test_cgi.rb9
-rw-r--r--test/webrick/test_filehandler.rb135
-rw-r--r--test/webrick/utils.rb12
-rwxr-xr-xtest/webrick/webrick_long_filename.cgi36
-rw-r--r--time.c7
-rw-r--r--version.h12
-rw-r--r--win32/Makefile.sub8
-rw-r--r--win32/mkexports.rb15
-rw-r--r--win32/setup.mak2
-rw-r--r--win32/win32.c161
-rw-r--r--win32/win32.h1
-rw-r--r--wince/setup.mak2
84 files changed, 658 insertions, 2568 deletions