Sha256: f880975dfebd0e6eae0ec86a490aa71fa369f41c9490084de3dadbabbb506e24

Contents?: true

Size: 301 Bytes

Versions: 28

Compression:

Stored size: 301 Bytes

Contents

describe "The defined? keyword for x-strings" do
  it "returns true for defined variables" do
    `var SomeClass = {}`
    defined?(`{}`).should be_true
    defined?(`SomeClass`).should be_true
  end

  it "retuens false for undefined variables" do
    defined?(`SomeBadVar`).should be_false
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
opal-0.4.4 spec/opal/runtime2/defined_spec.rb
opal-0.4.3 spec/opal/runtime2/defined_spec.rb
opal-0.4.2 spec/opal/runtime2/defined_spec.rb
opal-0.4.1 spec/opal/runtime2/defined_spec.rb
opal-0.4.0 spec/opal/runtime2/defined_spec.rb
opal-0.3.44 spec/rubyspec/core/runtime/defined_spec.rb
opal-0.3.43 spec/rubyspec/core/runtime/defined_spec.rb
opal-0.3.42 spec/core/runtime/defined_spec.rb
opal-0.3.41 spec/core/runtime/defined_spec.rb
opal-0.3.40 spec/core/runtime/defined_spec.rb
opal-0.3.39 spec/core/runtime/defined_spec.rb
opal-0.3.38 spec/core/runtime/defined_spec.rb
opal-0.3.37 spec/core/runtime/defined_spec.rb
opal-0.3.36 spec/core/runtime/defined_spec.rb
opal-0.3.35 spec/core/runtime/defined_spec.rb
opal-0.3.34 spec/core/runtime/defined_spec.rb
opal-0.3.33 spec/core/runtime/defined_spec.rb
opal-0.3.32 spec/core/runtime/defined_spec.rb
opal-0.3.31 spec/core/runtime/defined_spec.rb
opal-0.3.30 spec/core/runtime/defined_spec.rb