Skip to content

Commit

Permalink
Moving only() to general spec helpers, adding expect()
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Gross committed Jun 18, 2007
1 parent bf89af6 commit 890deed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 0 additions & 6 deletions spec/mini_rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@ def describe(msg)
@reporter.after_describe(msg)
end

def only(*args)
if Object.const_defined?(:RUBY_ENGINE) and args.include?(RUBY_ENGINE.to_sym)
yield
end
end

# Alternatives
class Object
alias context describe
Expand Down
12 changes: 12 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@
RUBY_NAME = RUBY_ENGINE
end
end

def only(*args)
if Object.const_defined?(:RUBY_ENGINE) and args.include?(RUBY_ENGINE.to_sym)
yield
end
end

def except(*args)
unless Object.const_defined?(:RUBY_ENGINE) and args.include?(RUBY_ENGINE.to_sym)
yield
end
end

0 comments on commit 890deed

Please sign in to comment.