Skip to content

Commit

Permalink
Javascript does not support all ruby regexp anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 30, 2013
1 parent 2a91f3b commit c9f3107
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -58,7 +58,8 @@ code.

* **line 547**: opal cannot use mutable strings (see opal/rspec/fixes.rb)

* **line 564**: opal cannot use mutable strings (see opal/rspec/fixes.rb)
* **line 564**: opal cannot use mutable strings (see opal/rspec/fixes.rb). Also, opal
does not support 2 regexp special characters yet (`\A` and `\z`).

### rspec/core/project_initializer.rb

Expand Down
2 changes: 1 addition & 1 deletion opal/opal/rspec/fixes.rb
Expand Up @@ -43,7 +43,7 @@ def self.base_name_for(group)

# Ruby requires first const letter to be A-Z. Use `Nested`
# as necessary to enforce that.
name = name.gsub(/\A([^A-Z]|\z)/, 'Nested$1')
name = name.gsub(/^([^A-Z]|$)/, 'Nested$1')

name
end
Expand Down

0 comments on commit c9f3107

Please sign in to comment.