Skip to content

Commit

Permalink
Small spec to check let() still works in nested groups
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 20, 2013
1 parent 22d7cd0 commit 9a899ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opal/opal/rspec/fixes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ def underscore(camel_cased_word)
word
end
end

# Opal does not yet support $1..$9 backrefs
class RSpec::Matchers::BuiltIn::BePredicate
def prefix_and_expected(symbol)
symbol.to_s =~ /^(be_(an?_)?)(.*)/
return $~[1], $~[3]
end
end
10 changes: 10 additions & 0 deletions spec/example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,13 @@ def some_helper
lambda { raise "wtf son" }.should raise_error(Exception)
end
end

describe "let on an inner scope" do
describe "inner context" do
let(:foo) { :bar }

it "should still work" do
foo.should eq(:bar)
end
end
end

0 comments on commit 9a899ec

Please sign in to comment.