Sha256: 09ed31697278dc5cef6a3cda504cb38aaae6961dc38cee8b376c6f4e16b71c98

Contents?: true

Size: 365 Bytes

Versions: 7

Compression:

Stored size: 365 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Kernel#alert' do
  it 'returns nil' do
    begin
      original_alert = `window.alert`
      message = nil
      `window.alert = function(string) { message = string; }`
      Kernel.alert('a message').should be_nil
      expect(message).to eq('a message')
    ensure
      `window.alert = #{original_alert}`
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
opal-jquery-0.5.2 spec-opal/kernel_spec.rb
opal-jquery-0.5.1 spec-opal/kernel_spec.rb
opal-jquery-0.5.0 spec-opal/kernel_spec.rb
opal-jquery-0.4.6 spec-opal/kernel_spec.rb
opal-jquery-0.4.5 spec-opal/kernel_spec.rb
opal-jquery-0.4.4 spec-opal/kernel_spec.rb
opal-jquery-0.4.3 spec-opal/kernel_spec.rb