Sha256: 4d7c6e5bd90da66398087a641ac333149401cacbf43ec9b1edaf41fe2831b52f

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

describe 'super without explicit argument' do
  it 'passes arguments named with js reserved word' do
    parent = Class.new do
      def test_args(*args) = args
      def test_rest_args(*args) = args
      def test_kwargs(**args) = args
      def test_rest_kwargs(**args) = args
    end
    klass = Class.new(parent) do
      def test_args(native) = super
      def test_rest_args(*native) = super
      def test_kwargs(native:) = super
      def test_rest_kwargs(**native) = super
    end

    klass.new.test_args(1).should == [1]
    klass.new.test_rest_args(2).should == [2]
    klass.new.test_kwargs(native: 3).should == {native: 3}
    klass.new.test_rest_kwargs(native: 4).should == {native: 4}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opal-1.4.1 spec/opal/core/language/super_spec.rb