summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/constructor_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/array/constructor_spec.rb')
-rw-r--r--spec/ruby/core/array/constructor_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/ruby/core/array/constructor_spec.rb b/spec/ruby/core/array/constructor_spec.rb
new file mode 100644
index 0000000000..c4398c535d
--- /dev/null
+++ b/spec/ruby/core/array/constructor_spec.rb
@@ -0,0 +1,24 @@
+require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
+
+describe "Array.[]" do
+ it "returns a new array populated with the given elements" do
+ obj = Object.new
+ Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
+
+ a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
+ a.should.instance_of?(ArraySpecs::MyArray)
+ a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
+ end
+end
+
+describe "Array[]" do
+ it "is a synonym for .[]" do
+ obj = Object.new
+ Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
+
+ a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
+ a.should.instance_of?(ArraySpecs::MyArray)
+ a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
+ end
+end
ruby_1_8'>ruby_1_8* 2014-01-28svn12 years ruby_1_9_1* 2011-08-25svn15 years ruby_1_8_6* 2010-09-02svn16 years ruby_1_8_5merge revision(s) 17483:shyouhei18 years ruby_1_3set svn:eol-styleshyouhei19 years ruby_1_4set svn:eol-styleshyouhei19 years ruby_1_6set svn:eol-styleshyouhei19 years v1_0rset svn:eol-styleshyouhei19 years v1_1devset svn:eol-styleshyouhei19 years v1_1rset svn:eol-styleshyouhei19 years  TagDownloadAuthorAge v4.0.4commit b89eb1bcbf...Takashi Kokubun4 weeks v4.0.3commit 85ddef263a...Takashi Kokubun7 weeks v3_2_11commit 5483bfc1ae...Hiroshi SHIBATA2 months v3_3_11commit 1f2d15125a...Hiroshi SHIBATA2 months v4.0.2commit d3da9fec82...Takashi Kokubun3 months v3_4_9commit 76cca827ab...nagachika3 months v3_2_10commit a3a6d25788...Hiroshi SHIBATA5 months v4.0.1commit e04267a14b...Takashi Kokubun5 months v4.0.0commit 553f1675f3...NARUSE, Yui5 months v4.0.0-preview3commit cfa3e7cf75...Augustin Gottlieb6 months v3_4_8commit 995b59f666...Takashi Kokubun6 months v4.0.0-preview2commit 4fa6e9938c...NARUSE, Yui7 months v3_3_10commit 343ea05002...nagachika7 months v3_4_7commit 7a5688e2a2...Takashi Kokubun8 months v3_4_6commit dbd83256b1...Takashi Kokubun9 months v3_3_9commit f5c772fc7c...nagachika10 months v3_2_9commit 8f611e0c46...Hiroshi SHIBATA10 months v3_4_5commit 20cda200d3...Takashi Kokubun11 months v3_4_4commit a38531fd3f...Takashi Kokubun13 months v3_5_0_preview1commit d06ec25be4...Takashi Kokubun14 months v3_4_3commit d0b7e5b6a0...Takashi Kokubun14 months v3_3_8commit b200bad6cd...nagachika14 months v3_1_7commit 0a3704f218...Hiroshi SHIBATA14 months v3_2_8commit 13f495dc2c...Hiroshi SHIBATA14 months v3_4_2commit d2930f8e7a...Takashi Kokubun16 months v3_2_7commit 02ec315244...nagachika16 months v3_3_7commit be31f993d7...Takashi Kokubun17 months v3_4_1commit 48d4efcb85...NARUSE, Yui17 months v3_4_0commit f450108330...Takashi Kokubun17 months v3_4_0_rc1commit 29caae9991...Kevin Newton18 months v3_3_6commit 75015d4c1f...Takashi Kokubun19 months v3_2_6commit 63aeb018eb...nagachika19 months v3_4_0_preview2commit 32c733f57b...Misaki Shioi20 months v3_3_5commit ef084cc8f4...Takashi Kokubun21 months v3_2_5commit 31d0f1a2e7...nagachika22 months v3_3_4commit be1089c8ec...Takashi Kokubun23 months v3_3_3commit f1c7b6f435...Takashi Kokubun24 months v3_3_2commit e5a195edf6...Takashi Kokubun2 years v3_1_6commit a777087be6...Hiroshi SHIBATA2 years v3_4_0_preview1commit 9d69619623...Nobuyoshi Nakada2 years v3_0_7commit 724a071175...Hiroshi SHIBATA2 years v3_1_5commit 1945f8dc0e...Hiroshi SHIBATA2 years v3_3_1commit c56cd86388...NARUSE, Yui2 years v3_2_4commit af471c0e01...nagachika2 years v3_2_3commit 52bb2ac0a6...nagachika2 years v3_3_0commit 5124f9ac75...NARUSE, Yui2 years v3_3_0_rc1commit a49643340e...NARUSE, Yui2 years v3_3_0_preview3commit 60e19a0b5f...Nobuyoshi Nakada3 years v3_3_0_preview2commit e50fcca9a7...Nathan Froyd3 years v3_3_0_preview1commit a1b01e7701...Yuichiro Kaneko3 years v3_0_6commit 23a532679b...NAKAMURA Usaku3 years v2_7_8commit 1f4d455848...NAKAMURA Usaku3 years v3_2_2commit e51014f9c0...NARUSE, Yui3 years v3_1_4commit 957bb7cb81...Hiroshi SHIBATA3 years v3_2_1commit 31819e82c8...NARUSE, Yui3 years v3_2_0commit a528908271...NARUSE, Yui3 years v3_2_0_rc1commit 81e274c990...Lars Kanis4 years v2_7_7commit 168ec2b1e5...NAKAMURA Usaku4 years v3_0_5commit ba5cf0f7c5...Kazuki Yamaguchi4 years v3_1_3commit 1a6b16756e...nagachika4 years v3_2_0_preview3commit 28611be6ee...Hiroshi SHIBATA4 years v3_2_0_preview2commit 35cfc9a3bb...Kevin Newton4 years v2_6_10commit 7b4ea5bb73...usa4 years v3_0_4commit 3fa771dded...nagachika4 years v2_7_6commit c9c2245c0a...NAKAMURA Usaku4 years v3_1_2commit 4491bb740a...NARUSE, Yui4 years v3_2_0_preview1commit f801386f0c...Nobuyoshi Nakada4 years v3_1_1commit 53f5fc4236...NARUSE, Yui4 years v3_1_0commit fb4df44d16...NARUSE, Yui4 years v2_6_9commit 8e26731f9e...usa5 years v2_7_5commit f69aeb8314...NAKAMURA Usaku5 years v3_0_3commit 3fb7d2cadc...nagachika5 years v3_1_0_preview1commit 5a3b2e6141...Nobuyoshi Nakada5 years v2_7_4commit a21a3b7d23...Yusuke Endoh5 years v2_6_8commit 768423edc2...usa5 years v3_0_2commit 0db68f0233...nagachika5 years v2_7_3commit 6847ee089d...nagachika5 years v3_0_1commit 0fb782ee38...Nobuyoshi Nakada5 years v2_6_7commit 930143880a...usa5 years v2_5_9commit ee47403ce0...usa5 years v3_0_0commit 95aff21468...TAKANO Mitsuhiro5 years v3_0_0_rc2commit a89932799c...NARUSE, Yui5 years v3_0_0_rc1commit 8680ae9cbd...Nobuyoshi Nakada5 years v3_0_0_preview2commit d7a16670c3...Nobuyoshi Nakada5 years v2_7_2commit 5445e04352...nagachika6 years v3_0_0_preview1commit 0096d2b895...Koichi Sasada6 years v2_5_8commit 4992d9fd70...usa6 years v2_4_10commit 27f6ad737b...usa6 years v2_6_6commit 27958c2bd6...nagachika6 years v2_7_1commit a0c7c23c9c...NARUSE, Yui6 years v2_7_0commit 647ee6f091...aycabta6 years v2_7_0_rc2commit 75acbd5f00...Yusuke Endoh6 years v2_7_0_rc1commit 8a40dce0ff...git6 years v2_7_0_preview3commit b563439274...Nobuyoshi Nakada7 years v2_7_0_preview2commit 02aadf1032...Yusuke Endoh7 years v2_4_9commit 7c94ba3401...usa7 years v2_4_8commit 52f881b82a...usa7 years v2_5_7commit 1c39daae0f...usa7 years v2_6_5commit 37c2cd3fa4...nagachika7 years v2_6_4commit 6315e42c22...nagachika7 years v2_5_6commit 189a36cfab...usa7 years v2_4_7commit c914780585...usa7 years v1_0_971003commit 7ad198827b...Yukihiro Matsumoto7 years v1_0_971015commit 2a4ba10e2d...Yukihiro Matsumoto7 years v1_0_971021commit 9b01ce6954...Yukihiro Matsumoto7 years v1_0_971118commit cfd31fa21b...Yukihiro Matsumoto7 years v1_0_971125commit ab261638f5...Yukihiro Matsumoto7 years v1_0_971204commit fb0fe24512...Yukihiro Matsumoto7 years v1_0_971209commit 66541bbb36...Yukihiro Matsumoto7 years v1_0_971225commit 4207990990...Yukihiro Matsumoto7 years v0_71commit 4e65eab7ab...Yukihiro Matsumoto7 years v0_72commit 11e21a36bc...Yukihiro Matsumoto7 years v0_73commit b2420d8ffa...Yukihiro Matsumoto7 years v0_76commit 8bf1c909dc...Yukihiro Matsumoto7 years v0_95commit fca49a8a69...Yukihiro Matsumoto7 years v0_99_4_961224commit 554b989ba1...Yukihiro Matsumoto7 years v1_0_961225commit ce930d0429...Yukihiro Matsumoto7 years v1_0_971002commit 10d21745c8...Yukihiro Matsumoto7 years v0_62commit b3f9ba5a37...Yukihiro Matsumoto7 years v0_63commit bd0c733b77...Yukihiro Matsumoto7 years v0_64commit 5d828b25d4...Yukihiro Matsumoto7 years v0_65commit 897cf06695...Yukihiro Matsumoto7 years v0_66commit c080fb6d10...Yukihiro Matsumoto7 years v0_67commit 2f106ab85c...Yukihiro Matsumoto7 years v0_68commit 881c5a9c32...Yukihiro Matsumoto7 years v0_69commit d349889e77...Yukihiro Matsumoto7 years v0_50commit 6e30904136...Yukihiro Matsumoto7 years v0_51commit eed5c920dd...Yukihiro Matsumoto7 years v0_52commit 173976c97c...Yukihiro Matsumoto7 years v0_54commit 29f237a8b1...Yukihiro Matsumoto7 years v0_55commit c31025779d...Yukihiro Matsumoto7 years v0_56commit 4dfd93c72a...Yukihiro Matsumoto7 years v0_60commit 00e36aa09f...Yukihiro Matsumoto7 years v0_49commit 200e0ee2fd...Yukihiro Matsumoto7 years v2_7_0_preview1commit c55db6aa27...git7 years v2_6_3commit 257fda2518...naruse7 years v2_4_6commit 5b36edf4ca...usa7 years v2_5_5commit f11c0b253c...nagachika7 years v2_5_4commit 1a84920668...nagachika7 years v2_6_2commit 300089b723...naruse7 years v2_6_1commit e6d1c72bec...naruse7 years v2_6_0commit c1af7b1e1d...naruse7 years v2_6_0_rc2commit c54428bbd7...naruse7 years v2_6_0_rc1commit c7ee7e4205...naruse8 years v2_6_0_preview3commit 7ccad5680d...naruse8 years v2_5_3commit c4b6652223...nagachika8 years v2_4_5commit a0143aa5e4...usa8 years v2_3_8commit 8d23556886...usa8 years v2_5_2commit bf508be28b...nagachika8 years v2_6_0_preview2commit 6f59db30c1...naruse8 years v2_5_1commit 85883dc393...naruse8 years v2_3_7commit 9bfe7fc5cb...usa8 years v2_2_10commit 933bb2b8b5...usa8 years v2_4_4commit a8197e08f5...nagachika8 years v2_6_0_preview1commit ce0e3fc1b1...naruse8 years v2_5_0commit 4e0a512972...naruse8 years v2_3_6commit 2551734626...usa8 years v2_2_9commit 72113d58cd...usa8 years v2_4_3commit a5ec07c73f...nagachika8 years v2_5_0_rc1commit c6f401b6b8...naruse8 years v2_5_0_preview1commit f11fbd79fd...naruse9 years v2_2_8commit f3c3c788aa...usa9 years v2_3_5commit e07613e27e...usa9 years v2_4_2commit 595af866bb...nagachika9 years v2_3_4commit 4bd69735af...nagachika9 years v2_2_7commit 530165c294...usa9 years v2_4_1commit 820605ba3c...naruse9 years v2_4_0commit d4bb726b71...naruse9 years v2_4_0_rc1commit 55b2febff0...naruse9 years v2_3_3commit c91cb76f8d...nagachika10 years v2_2_6commit 1c091e3480...usa10 years v2_3_2commit 9d222264d5...nagachika10 years v2_4_0_preview3commit 81234c5eca...naruse10 years v2_4_0_preview2commit e11c22602a...naruse10 years v2_4_0_preview1commit 8183c05322...naruse10 years v2_2_5commit 449169fd8c...usa10 years v2_3_1commit 5827d8e887...nagachika10 years v2_1_10commit 410b031acb...usa10 years v2_1_9commit 22b2eface0...usa10 years v2_3_0commit d40ea2afa6...naruse10 years v2_0_0_648commit 03ec9ed5c9...usa10 years v2_1_8commit 4876b9a68c...usa10 years v2_2_4commit 9081c2c61a...nagachika10 years v2_3_0_preview2commit e3434401ac...naruse10 years v2_3_0_preview1commit 9993701c7d...naruse11 years v2_2_3commit b8c7ea548a...nagachika11 years v2_1_7commit 0f664738e9...usa11 years v2_0_0_647commit c60c15f371...usa11 years v2_0_0_645commit 5dfbc71593...usa11 years v2_1_6commit fe8cc13685...usa11 years v2_2_2commit a9721a2596...nagachika11 years v2_2_1commit 10bc9b85cb...naruse11 years v2_0_0_643commit 5b16662562...usa11 years v2_2_0commit 7393bf6a5c...naruse11 years v2_2_0_rc1commit 050b43acce...naruse11 years v2_2_0_preview2commit 2e968a2338...naruse12 years v2_0_0_598commit 52fda370bc...usa12 years v1_9_3_551commit a32f378924...usa12 years v2_1_5commit 02560c6a79...nagachika12 years v2_0_0_594commit 34b929aeb3...usa12 years v2_1_4commit 0026b21550...nagachika12 years v1_9_3_550commit abd7e6526f...usa12 years v2_1_3commit 63858b8d25...nagachika12 years v2_0_0_576commit f1f3fe11d9...usa12 years v2_2_0_preview1commit ac98aa3101...naruse12 years v1_9_3_547commit b75e21b2bc...usa12 years v2_0_0_481commit 3eae974b3c...usa12 years v2_1_2commit faba7187c5...nagachika12 years v2_0_0_451commit 6d64b00091...nagachika12 years v2_1_1commit 80b4d996e7...naruse12 years v1_9_3_545commit c7306a6eca...usa12 years v2_1_0commit 3603063e43...naruse12 years v2_1_0_rc1commit 9881a183bd...naruse12 years v2_1_0_preview2commit 834679d12c...naruse13 years v1_9_3_484commit 71b69b4120...usa13 years v2_0_0_353commit 609cdd3236...nagachika13 years v2_0_0_352commit e438ab420e...nagachika13 years v1_9_3_483commit e0b7e4bc22...usa13 years v2_1_0_preview1commit 928c4a92de...naruse13 years v1_8_7_374commit 83c8cd7199...shyouhei13 years v1_8_7_373commit 1c7b7da575...shyouhei13 years v1_9_3_448commit 4cf80d0c24...usa13 years v2_0_0_247commit a921f0ec57...nagachika13 years v1_9_3_429commit 5266a83418...usa13 years v1_9_3_426commit e76eb06feb...usa13 years v2_0_0_195commit e0030c175a...nagachika13 years v2_0_0_0commit 22cc613086...mame13 years v1_9_3_392commit fd5c678ff7...usa13 years v2_0_0_rc2commit 324fab490a...mame13 years v1_9_3_385commit b0104369bc...usa13 years v1_9_3_384commit 513746f662...usa13 years v1_9_3_383commit 076ff3b10c...usa13 years v1_9_3_374commit 92e872fa45...usa13 years v2_0_0_rc1commit ca6ccd436b...mame13 years v1_9_3_362commit 99fa4b0ea6...usa13 years v1_9_3_361commit 8a31db57d8...usa13 years v1_9_3_360commit 7b91c87317...usa13 years v2_0_0_preview2commit eb57022d05...mame14 years v1_9_3_327commit c49ae7ae02...usa14 years v1_9_3_326commit 40f7da0658...usa14 years v2_0_0_preview1commit 9f51be4b00...naruse14 years v1_9_3_286commit 6c55027f98...usa14 years v1_9_3_284commit 400b5d3a91...usa14 years v1_9_3_283commit 9089f9aad6...usa14 years v1_8_7_371commit 0ef2a114b5...shyouhei14 years v1_8_7_370commit 6b7998db38...shyouhei14 years v1_8_7_369commit c2086e5c29...shyouhei14 years v1_9_2_320commit ea0b32f984...