I know there is a hash_including, which is quite useful. Are there by chance any matchers for ensuring a hash includes only the specified values, or that it doesn''t have certain values? Thanks, Steve
On Wed, Aug 6, 2008 at 9:22 AM, Steve <vertebrate at gmail.com> wrote:> I know there is a hash_including, which is quite useful. Are there by > chance any matchers for ensuring a hash includes only the specified values, > or that it doesn''t have certain values? >I''m just on my way out the door, but just wanted to say that if there isn''t, writing your own matcher is super easy. ///ark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080806/39d8a506/attachment.html>
Mark Wilden wrote:> On Wed, Aug 6, 2008 at 9:22 AM, Steve > <vertebrate at gmail.com > <mailto:vertebrate at gmail.com>> wrote: > > I know there is a hash_including, which is quite useful. Are there > by chance any matchers for ensuring a hash includes only the > specified values, or that it doesn''t have certain values? > > > I''m just on my way out the door, but just wanted to say that if there > isn''t, writing your own matcher is super easy. > > ///ark >Yeah, I just wanted to make sure the functionality didn''t exist before I wrote my own.
Steve wrote:> Mark Wilden wrote: >> On Wed, Aug 6, 2008 at 9:22 AM, Steve <vertebrate at gmail.com >> <mailto:vertebrate at gmail.com>> wrote: >> >> I know there is a hash_including, which is quite useful. Are there >> by chance any matchers for ensuring a hash includes only the >> specified values, or that it doesn''t have certain values? >>How about using should_not to ensure it doesn''t have these values? Jony>> >> I''m just on my way out the door, but just wanted to say that if there >> isn''t, writing your own matcher is super easy. >> >> ///ark >> > > Yeah, I just wanted to make sure the functionality didn''t exist before > I wrote my own. > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Apparently Analagous Threads
- Problems with form_for and partials
- any tricks re using " eql(5.5)", but where 5.5 is a decimal not float?
- Is there an equivalent to anything() for Hash parameters?
- rspec causing validates_presence_of to validate twice?
- Mocking/Stubbing ActiveRecord.config.default_timezone