Sha256: 6d9a45e6f86b2d995bdcc5710971344b06e5e98318794cf9cf13a3fddd6f3a5f

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

# 
# describe "The super keyword" do
#   
#   it "calls the method on the calling class" do
#     Super::S1::A.new.foo([]).should == ["A#foo", "A#bar"]
#     Super::S1::A.new.bar([]).should == ["A#bar"]
#     Super::S1::B.new.foo([]).should == ["B#foo","A#foo","B#bar","A#bar"]
#     Super::S1::B.new.bar([]).should == ["B#bar", "A#bar"]
#   end
#   
#   it "searches the full inheritence chain" do
#     Super::S2::B.new.foo([]).should == ["B#foo", "A#baz"]
#     Super::S2::B.new.baz([]).should == ["A#baz"]
#     Super::S2::C.new.foo([]).should == ["B#foo","C#baz","A#baz"]
#     Super::S2::C.new.baz([]).should == ["C#baz","A#baz"]
#   end
#   
#   it "searches class methods" do
#     Super::S3::A.new.foo([]).should == ["A#foo"]
#     Super::S3::A.foo([]).should == ["A::foo"]
#     Super::S3::A.bar([]).should == ["A::bar","A::foo"]
#     Super::S3::B.new.foo([]).should == ["A#foo"]
#     Super::S3::B.foo([]).should == ["B::foo","A::foo"]
#     Super::S3::B.bar([]).should == ["B::bar","A::bar","B::foo","A::foo"]
#   end
# end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opal-0.2.2 opals/opal/opal/spec/language/super_spec.rb
opal-0.2.0 opals/opal/opal/spec/language/super_spec.rb
opal-0.1.0 opals/opal/spec/language/super_spec.rb