Sha256: 00927126634038c7ac86c4bfab2c2e8654519db6c75dd1b25d4d7c1ff5d7bace

Contents?: true

Size: 559 Bytes

Versions: 56

Compression:

Stored size: 559 Bytes

Contents

describe "not()" do
  # not(arg).method and method(not(arg)) raise SyntaxErrors on 1.8. Here we
  # use #inspect to test that the syntax works on 1.9

  it "can be used as a function" do
    lambda do
      not(true).inspect
    end.should_not raise_error(SyntaxError)
  end

  it "returns false if the argument is true" do
    not(true).inspect.should == "false"
  end

  it "returns true if the argument is false" do
    not(false).inspect.should == "true"
  end

  it "returns true if the argument is nil" do
    not(nil).inspect.should == "true"
  end
end

Version data entries

56 entries across 56 versions & 3 rubygems

Version Path
opal-0.9.0.rc1 spec/opal/core/language/versions/not_1.9.rb
opal-0.9.0.beta2 spec/opal/core/language/versions/not_1.9.rb
opal-0.9.0.beta1 spec/opal/core/language/versions/not_1.9.rb
opal-0.8.1 spec/opal/core/language/versions/not_1.9.rb
opal-0.8.1.rc1 spec/opal/core/language/versions/not_1.9.rb
opal-wedge-0.9.0.dev spec/opal/core/language/versions/not_1.9.rb
opal-0.8.0 spec/opal/core/language/versions/not_1.9.rb
opal-0.8.0.rc3 spec/opal/core/language/versions/not_1.9.rb
opal-0.8.0.rc2 spec/opal/core/language/versions/not_1.9.rb
opal-0.8.0.rc1 spec/opal/core/language/versions/not_1.9.rb
opal-0.8.0.beta1 spec/opal/core/language/versions/not_1.9.rb
opal-0.7.2 spec/opal/core/language/versions/not_1.9.rb
opal-0.7.1 spec/opal/core/language/versions/not_1.9.rb
opal-0.7.0 spec/opal/core/language/versions/not_1.9.rb
opal-0.7.0.rc1 spec/opal/core/language/versions/not_1.9.rb
opal-0.7.0.beta3 spec/opal/core/language/versions/not_1.9.rb
opal-0.6.3 spec/opal/core/language/versions/not_1.9.rb
opal-0.7.0.beta2 spec/opal/core/language/versions/not_1.9.rb
opal-cj-0.7.0.beta2 spec/opal/core/language/versions/not_1.9.rb
opal-cj-0.7.0.beta1 spec/opal/core/language/versions/not_1.9.rb