Sha256: eece2ec2df63d2822cf80a324b21c81927e425ac0c3ae23936a5af737a217dfb

Contents?: true

Size: 440 Bytes

Versions: 49

Compression:

Stored size: 440 Bytes

Contents

describe "Literal Regexps" do
  it "yields a Regexp" do
    /Hello/.should be_kind_of(Regexp)
  end
end

describe "Regexps with interpolation" do
  it "allows interpolation of strings" do
    str = "foo|bar"
    /#{str}/.should == /foo|bar/
  end

  it "allows interpolation to interact with other Regexp constructs" do
    str = "foo)|(bar"
    /(#{str})/.should == /(foo)|(bar)/

    str = "a"
    /[#{str}-z]/.should == /[a-z]/
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
opal-0.8.0.beta1 spec/opal/core/language/regexp_spec.rb
opal-0.7.2 spec/opal/core/language/regexp_spec.rb
opal-0.7.1 spec/opal/core/language/regexp_spec.rb
opal-0.7.0 spec/opal/core/language/regexp_spec.rb
opal-0.7.0.rc1 spec/opal/core/language/regexp_spec.rb
opal-0.7.0.beta3 spec/opal/core/language/regexp_spec.rb
opal-0.6.3 spec/opal/core/language/regexp_spec.rb
opal-0.7.0.beta2 spec/opal/core/language/regexp_spec.rb
opal-cj-0.7.0.beta2 spec/opal/core/language/regexp_spec.rb
opal-cj-0.7.0.beta1 spec/opal/core/language/regexp_spec.rb
opal-0.7.0.beta1 spec/opal/core/language/regexp_spec.rb
opal-0.6.2 spec/opal/core/language/regexp_spec.rb
opal-0.6.1 spec/opal/core/language/regexp_spec.rb
opal-0.6.0 spec/opal/core/language/regexp_spec.rb
opal-0.5.5 spec/opal/core/language/regexp_spec.rb
opal-0.5.4 spec/corelib/language/regexp_spec.rb
opal-0.5.2 spec/corelib/language/regexp_spec.rb
opal-0.5.0 spec/corelib/language/regexp_spec.rb
opal-0.4.4 spec/rubyspec/language/regexp_spec.rb
opal-0.4.3 spec/rubyspec/language/regexp_spec.rb