Sha256: 849471c4b17cc9ed368c7cafdf105d061905ae13b160173d851ca658625cf35f

Contents?: true

Size: 383 Bytes

Versions: 6

Compression:

Stored size: 383 Bytes

Contents

# backtick_javascript: true

describe 'Safe navigator' do
  it "handles also null and undefined" do
    [`null`, `undefined`].each do |value|
      value&.unknown.should == nil
    end
  end

  it "calls a receiver exactly once" do
    def receiver
      @calls += 1
    end
    @calls = 0
    receiver&.itself.should == 1
    @calls = 0
    receiver&.itself{}.should == 1
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opal-1.8.3.rc1 spec/opal/core/language/safe_navigator_spec.rb
opal-1.8.2 spec/opal/core/language/safe_navigator_spec.rb
opal-1.8.1 spec/opal/core/language/safe_navigator_spec.rb
opal-1.8.0 spec/opal/core/language/safe_navigator_spec.rb
opal-1.8.0.beta1 spec/opal/core/language/safe_navigator_spec.rb
opal-1.8.0.alpha1 spec/opal/core/language/safe_navigator_spec.rb