ホーム > 今日のテストコード > rspecのincludeマッチャ

rspecのincludeマッチャ

rspecのincludeマッチャ。Hashの場合の挙動はバージョン間で色々と違いがありますね。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require 'rubygems'
gem 'rspec', '>= 1.1.12'
require 'spec'
 
describe 'includeマッチャ' do
 
  before :each do
    @lang_authors = { 
      :ruby => 'まつもとゆきひろ',
      :python => 'Guido van Rossum',
      :perl => 'Larry Wall'
    }
  end
 
  it 'Hashが指定されたキーを持つか' do
    # 以下はrspec 1.1.10, 1.1.11 でエラーになる
    @lang_authors.should include(:ruby)
    @lang_authors.should include(:python)
    @lang_authors.should_not include(:vb)
  end
 
  it 'Hashが指定されたキーと値の組み合わせを持つか' do
    # 以下はrspec 1.1.10より前だと失敗する
    @lang_authors.should include(:ruby => 'まつもとゆきひろ')
    @lang_authors.should_not include(:ruby => 'まつもとひろゆき')
  end
 
  it 'その他はinclude?による評価' do
    @lang_authors[:python].should include('os')
    @lang_authors.keys.should include(:perl)
  end
 
end

参考:

  1. 2020 年 6 月 29 日 20:27 | #1

    Great write-up, I am normal visitor of one¡¦s blog, maintain up the excellent operate, and It’s going to be a regular visitor for a long time.

  2. 2020 年 6 月 29 日 20:33 | #2

    Excellent site you have got here.. It’s hard to find excellent writing like yours these days. I seriously appreciate people like you! Take care!!

  3. 2020 年 6 月 29 日 20:42 | #3

    This website was… how do I say it? Relevant!! Finally I’ve found something which helped me. Thanks!

  4. 2020 年 6 月 29 日 20:43 | #4

    Your style is unique in comparison to other people I have read stuff from. Thanks for posting when you’ve got the opportunity, Guess I will just bookmark this page.

  5. 2020 年 6 月 29 日 21:11 | #5

    An interesting discussion is definitely worth comment. I do think that you should write more about this subject, it may not be a taboo subject but generally folks don’t talk about such topics. To the next! Cheers!!

  6. 2020 年 6 月 29 日 21:12 | #6

    This is a very good tip particularly to those new to the blogosphere. Simple but very precise info… Appreciate your sharing this one. A must read post!

  7. 2020 年 6 月 29 日 21:18 | #7

    I needed to thank you for this wonderful read!! I absolutely enjoyed every bit of it. I have got you book marked to check out new stuff you post…

  8. 2020 年 6 月 29 日 21:29 | #8

    A fascinating discussion is definitely worth comment. I think that you ought to publish more on this issue, it may not be a taboo matter but generally people don’t talk about such topics. To the next! Many thanks!!

  9. Johnny Danco
    2020 年 6 月 29 日 21:30 | #9

    This is a extremely fascinating post. Hinder my purlieus free account generator fortnite

  10. 2020 年 6 月 29 日 21:35 | #10

    I’m amazed, I have to admit. Seldom do I come across a blog that’s both equally educative and entertaining, and without a doubt, you’ve hit the nail on the head. The problem is something not enough folks are speaking intelligently about. I’m very happy that I stumbled across this during my search for something concerning this.

  11. 2020 年 6 月 29 日 22:27 | #11

    Excellent post. I will be facing many of these issues as well..

  12. 2020 年 6 月 29 日 23:23 | #12

    Good post. I learn something totally new and challenging on sites I stumbleupon everyday. It’s always helpful to read articles from other writers and use a little something from their web sites.

  13. 2020 年 6 月 29 日 23:30 | #13

    Having read this I believed it was very informative. I appreciate you taking the time and energy to put this short article together. I once again find myself spending way too much time both reading and leaving comments. But so what, it was still worthwhile!

  14. 2020 年 6 月 29 日 23:47 | #14

    I love it when individuals get together and share views. Great site, stick with it!

  15. 2020 年 6 月 30 日 00:10 | #15

    I love it when folks get together and share thoughts. Great website, continue the good work!

  16. 2020 年 6 月 30 日 00:33 | #16

    I love reading an article that can make people think. Also, thanks for allowing for me to comment!

  17. 2020 年 6 月 30 日 00:37 | #17

    I couldn’t refrain from commenting. Very well written!

  18. 2020 年 6 月 30 日 00:44 | #18

    The very next time I read a blog, Hopefully it does not fail me as much as this particular one. After all, I know it was my choice to read through, but I actually believed you would probably have something useful to talk about. All I hear is a bunch of moaning about something that you could possibly fix if you weren’t too busy searching for attention.

  19. 2020 年 6 月 30 日 01:07 | #19

    Having read this I thought it was really enlightening. I appreciate you spending some time and effort to put this short article together. I once again find myself spending way too much time both reading and commenting. But so what, it was still worthwhile!

  20. 2020 年 6 月 30 日 01:09 | #20

    You should be a part of a contest for one of the best sites on the internet. I will recommend this site!

  21. 2020 年 6 月 30 日 01:28 | #21

    I blog quite often and I truly thank you for your content. Your article has really peaked my interest. I am going to book mark your website and keep checking for new information about once a week. I subscribed to your Feed as well.

  22. 2020 年 6 月 30 日 01:36 | #22

    bookmarked!!, I really like your website!

  23. 2020 年 6 月 30 日 01:57 | #23

    Pretty! This has been an extremely wonderful article. Thank you for supplying these details.

  24. 2020 年 6 月 30 日 02:04 | #24

    This site was… how do you say it? Relevant!! Finally I’ve found something that helped me. Cheers!

  25. 2020 年 6 月 30 日 02:08 | #25

    Can I just say what a relief to find someone that genuinely knows what they’re talking about on the web. You definitely understand how to bring an issue to light and make it important. More and more people must read this and understand this side of your story. I was surprised you aren’t more popular since you definitely possess the gift.

  26. 2020 年 6 月 30 日 02:09 | #26

    Oh my goodness! Incredible article dude! Thank you, However I am experiencing difficulties with your RSS. I don’t understand why I can’t join it. Is there anyone else having the same RSS problems? Anyone that knows the solution can you kindly respond? Thanks!!

  27. 2020 年 6 月 30 日 02:22 | #27

    I want to to thank you for this great read!! I absolutely enjoyed every bit of it. I have you book-marked to check out new things you post…

  28. 2020 年 6 月 30 日 06:42 | #28

    Thank you so much for providing individuals with remarkably brilliant chance to read critical reviews from this web site. It’s always very lovely and packed with a good time for me and my office mates to visit the blog nearly three times in a week to see the fresh tips you have got. Of course, we’re at all times happy with the unbelievable principles served by you. Some 3 ideas in this article are absolutely the very best I have ever had.

  29. 2020 年 6 月 30 日 07:37 | #29
  30. 2020 年 6 月 30 日 08:14 | #30
  31. 2020 年 6 月 30 日 12:49 | #31

    I like it when people come together and share thoughts. Great site, stick with it!

  32. 2020 年 6 月 30 日 12:56 | #32

    Good post. I learn something new and challenging on blogs I stumbleupon on a daily basis. It will always be exciting to read through content from other writers and practice something from their websites.

  33. 2020 年 6 月 30 日 12:56 | #33

    I truly appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thanks again

  34. 2020 年 6 月 30 日 12:57 | #34

    That is a great tip particularly to those new to the blogosphere. Short but very accurate information… Thanks for sharing this one. A must read article!

  35. 2020 年 6 月 30 日 13:07 | #35

    you’re truly a good webmaster. The web site loading pace is amazing. It sort of feels that you are doing any unique trick. Moreover, The contents are masterpiece. you have performed a great activity on this topic!

  36. 2020 年 6 月 30 日 13:16 | #36

    Right here is the perfect site for everyone who really wants to understand this topic. You understand so much its almost hard to argue with you (not that I actually would want to…HaHa). You definitely put a brand new spin on a subject that has been discussed for years. Excellent stuff, just great!

  37. 2020 年 6 月 30 日 13:17 | #37

    I could not resist commenting. Perfectly written!

  38. 2020 年 6 月 30 日 13:26 | #38

    It’s difficult to find experienced people in this particular subject, however, you seem like you know what you’re talking about! Thanks

  39. 2020 年 6 月 30 日 13:30 | #39

    Good post. I definitely love this website. Continue the good work!

  40. 2020 年 6 月 30 日 13:30 | #40

    I like reading an article that will make men and women think. Also, thank you for permitting me to comment!

  41. 2020 年 6 月 30 日 13:35 | #41

    You are so cool! I do not suppose I’ve truly read something like that before. So wonderful to find another person with unique thoughts on this topic. Seriously.. thanks for starting this up. This web site is something that’s needed on the web, someone with a little originality!

  42. 2020 年 6 月 30 日 14:42 | #42

    Having read this I believed it was extremely enlightening. I appreciate you spending some time and energy to put this informative article together. I once again find myself personally spending a significant amount of time both reading and posting comments. But so what, it was still worthwhile!

  43. 2020 年 6 月 30 日 14:44 | #43

    Your style is unique in comparison to other folks I have read stuff from. I appreciate you for posting when you have the opportunity, Guess I’ll just book mark this blog.

  44. 2020 年 6 月 30 日 14:44 | #44

    Howdy! I just would like to give you a big thumbs up for your excellent info you have right here on this post. I am returning to your site for more soon.

  45. 2020 年 6 月 30 日 15:08 | #45

    I must thank you for the efforts you’ve put in penning this website. I really hope to view the same high-grade blog posts from you in the future as well. In truth, your creative writing abilities has encouraged me to get my very own website now ;)

  46. 2020 年 6 月 30 日 15:12 | #46

    Spot on with this write-up, I honestly feel this website needs a lot more attention. I’ll probably be returning to read more, thanks for the info!

  47. 2020 年 6 月 30 日 15:14 | #47

    I’d like to thank you for the efforts you’ve put in writing this site. I am hoping to check out the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has motivated me to get my own site now ;)

  48. 2020 年 6 月 30 日 16:35 | #48

    Your style is really unique compared to other people I’ve read stuff from. I appreciate you for posting when you’ve got the opportunity, Guess I will just book mark this page.

  49. 2020 年 6 月 30 日 16:56 | #49

    There is certainly a great deal to find out about this subject. I love all of the points you’ve made.

  50. 2020 年 6 月 30 日 17:08 | #50

    An interesting discussion is definitely worth comment. There’s no doubt that that you should publish more on this issue, it might not be a taboo subject but generally people do not discuss these subjects. To the next! Cheers!!

コメントページ
1 91 92 93 94 95 102 344
  1. 2020 年 4 月 14 日 19:42 | #1
  2. 2020 年 4 月 20 日 11:24 | #2
  3. 2020 年 4 月 26 日 04:06 | #3
  4. 2020 年 4 月 26 日 09:54 | #4
  5. 2020 年 4 月 30 日 00:35 | #5
  6. 2020 年 5 月 5 日 14:56 | #6
  7. 2020 年 5 月 5 日 19:12 | #7
  8. 2020 年 5 月 10 日 00:44 | #8
  9. 2020 年 6 月 30 日 00:36 | #9