Skip to content

Commit

Permalink
Make it rspec-rails compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmerouze committed Jul 28, 2009
1 parent 4e27e05 commit 4920776
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 7 additions & 2 deletions lib/remarkable_mongomapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,10 @@
Dir[File.join(dir, 'remarkable_mongomapper', 'matchers', '*.rb')].each do |file|
require file
end

Remarkable.include_matchers!(Remarkable::MongoMapper, Spec::Example::ExampleGroup)

# Include Remarkable MongoMapper matcher in appropriate ExampleGroup
if defined?(Spec::Rails)
Remarkable.include_matchers!(Remarkable::MongoMapper, Spec::Rails::Example::ModelExampleGroup)
else
Remarkable.include_matchers!(Remarkable::MongoMapper, Spec::Example::ExampleGroup)
end
2 changes: 1 addition & 1 deletion lib/remarkable_mongomapper/matchers/have_key_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HaveKeyMatcher < Remarkable::Base #:nodoc:
protected

def has_key?
@subject.respond_to?(@key) && @subject.respond_to?("#{@key}=")
@subject.reader?(@key) && @subject.writer?(@key)
end

end
Expand Down
6 changes: 2 additions & 4 deletions spec/spec.opts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
--colour
--format
progress
--loadby
mtime
--format progress
--loadby mtime
--reverse

0 comments on commit 4920776

Please sign in to comment.