ホーム > 今日のテストコード > テンポラリディレクトリを使ったテスト

テンポラリディレクトリを使ったテスト

テスト中にファイル書き込みを行いたいのでテンポラリディレクトリを利用する。終わったら掃除。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'rubygems'
require 'spec'
require 'tmpdir'
 
describe 'テンポラリディレクトリを使ったテスト' do
  before :all do
    @tmp = Dir.mktmpdir
  end
 
  it 'なんらかのテスト' do
    # @tmp に書き込みを行うテストなど
  end
 
  after :all do
    FileUtils.remove_entry_secure @tmp if File.exist?(@tmp)
  end
end

参考:

  1. 2020 年 7 月 6 日 05:41 | #1

    Hi, I believe your site could be having internet browser compatibility issues. When I look at your blog in Safari, it looks fine however, if opening in Internet Explorer, it’s got some overlapping issues. I merely wanted to give you a quick heads up! Other than that, fantastic website!

  2. 2020 年 7 月 6 日 05:45 | #2

    Good post. I learn something totally new and challenging on sites I stumbleupon every day. It will always be exciting to read content from other authors and practice something from other sites.

  3. 2020 年 7 月 6 日 05:49 | #3

    Good site you’ve got here.. It’s difficult to find quality writing like yours nowadays. I really appreciate people like you! Take care!!

  4. 2020 年 7 月 6 日 06:08 | #4

    I want to to thank you for this good read!! I certainly enjoyed every little bit of it. I’ve got you bookmarked to look at new stuff you post…

  5. 2020 年 7 月 6 日 06:41 | #5

    Having read this I believed it was rather informative. I appreciate you spending some time and effort to put this information together. I once again find myself spending a significant amount of time both reading and posting comments. But so what, it was still worth it!

  6. 2020 年 7 月 6 日 06:50 | #6

    Right here is the perfect site for anybody who really wants to understand this topic. You know a whole lot its almost tough to argue with you (not that I personally would want to…HaHa). You certainly put a new spin on a subject that’s been written about for ages. Wonderful stuff, just excellent!

  7. 2020 年 7 月 6 日 07:02 | #7

    Hello there! I could have sworn I’ve been to your blog before but after looking at some of the posts I realized it’s new to me. Nonetheless, I’m certainly delighted I found it and I’ll be bookmarking it and checking back regularly!

  8. 2020 年 7 月 6 日 07:14 | #8

    You’ve made some really good points there. I checked on the net for more information about the issue and found most people will go along with your views on this website.

  9. 2020 年 7 月 6 日 07:35 | #9

    Pretty! This has been an extremely wonderful article. Thank you for supplying this info.

  10. 2020 年 7 月 6 日 07:54 | #10

    I was very happy to discover this great site. I want to to thank you for ones time for this particularly fantastic read!! I definitely really liked every part of it and i also have you book marked to look at new information in your site.

  11. 2020 年 7 月 6 日 07:57 | #11

    Howdy! I could have sworn I’ve been to this blog before but after browsing through many of the posts I realized it’s new to me. Anyhow, I’m certainly happy I found it and I’ll be bookmarking it and checking back regularly!

  12. 2020 年 7 月 6 日 07:58 | #12

    Spot on with this write-up, I seriously believe this site needs far more attention. I’ll probably be back again to read through more, thanks for the information!

  13. 2020 年 7 月 6 日 12:14 | #13

    It¡¦s actually a great and helpful piece of info. I am glad that you simply shared this useful information with us. Please stay us up to date like this. Thanks for sharing.

  14. 2020 年 7 月 6 日 12:26 | #14

    Hi there! This post couldn’t be written much better! Going through this post reminds me of my previous roommate! He constantly kept talking about this. I am going to forward this post to him. Fairly certain he’s going to have a great read. Many thanks for sharing!

  15. 2020 年 7 月 6 日 12:28 | #15
  16. 2020 年 7 月 6 日 12:37 | #16

    I like it when individuals come together and share thoughts. Great blog, keep it up!

  17. 2020 年 7 月 6 日 12:47 | #17

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

  18. 2020 年 7 月 6 日 12:56 | #18

    I wish to show my affection for your generosity in support of men who really want help with this concern. Your special dedication to passing the message across appears to be incredibly powerful and have regularly helped workers like me to attain their dreams. This interesting report signifies a lot to me and somewhat more to my fellow workers. Warm regards; from each one of us.

  19. 2020 年 7 月 6 日 13:03 | #19

    This is a topic that’s close to my heart… Cheers! Exactly where are your contact details though?

  20. 2020 年 7 月 6 日 13:05 | #20

    Ynbblv xfjooh lasix dosage lasix for sale

  21. 2020 年 7 月 6 日 13:30 | #21

    I blog often and I seriously appreciate your content. Your article has truly peaked my interest. I am going to take a note of your site and keep checking for new details about once a week. I subscribed to your RSS feed as well.

  22. 2020 年 7 月 6 日 13:30 | #22

    You actually make it seem so easy together with your presentation however I to find this topic to be actually something which I think I might never understand. It sort of feels too complicated and extremely large for me. I am having a look forward for your subsequent post, I¡¦ll try to get the dangle of it!

  23. 2020 年 7 月 6 日 13:45 | #23

    An interesting discussion is worth comment. I do think that you ought to write more about this subject matter, it may not be a taboo subject but generally people don’t talk about these issues. To the next! Many thanks!!

  24. 2020 年 7 月 6 日 13:57 | #24

    I love it when people get together and share ideas. Great blog, continue the good work!

  25. 2020 年 7 月 6 日 14:05 | #25

    Hello! I could have sworn I’ve been to your blog before but after browsing through a few of the articles I realized it’s new to me. Anyways, I’m definitely happy I discovered it and I’ll be book-marking it and checking back frequently!

  26. 2020 年 7 月 6 日 14:09 | #26

    An outstanding share! I’ve just forwarded this onto a co-worker who had been conducting a little research on this. And he actually bought me breakfast because I stumbled upon it for him… lol. So allow me to reword this…. Thank YOU for the meal!! But yeah, thanx for spending time to discuss this issue here on your website.

コメントページ
1 157 158 159 312
  1. 2020 年 4 月 15 日 02:59 | #1
  2. 2020 年 4 月 20 日 10:51 | #2
  3. 2020 年 4 月 25 日 08:35 | #3
  4. 2020 年 4 月 26 日 09:09 | #4
  5. 2020 年 4 月 30 日 01:23 | #5
  6. 2020 年 5 月 5 日 16:25 | #6
  7. 2020 年 5 月 8 日 22:53 | #7
  8. 2020 年 5 月 9 日 21:27 | #8
  9. 2020 年 5 月 31 日 04:15 | #9
  10. 2020 年 6 月 1 日 08:17 | #10
  11. 2020 年 6 月 4 日 19:10 | #11
  12. 2020 年 6 月 6 日 16:35 | #12
  13. 2020 年 6 月 6 日 19:03 | #13
  14. 2020 年 6 月 7 日 06:14 | #14
  15. 2020 年 6 月 7 日 06:51 | #15
  16. 2020 年 6 月 8 日 05:17 | #16
  17. 2020 年 6 月 10 日 16:54 | #17
  18. 2020 年 6 月 10 日 17:56 | #18
  19. 2020 年 6 月 10 日 19:40 | #19
  20. 2020 年 6 月 10 日 21:23 | #20
  21. 2020 年 6 月 11 日 01:47 | #21
  22. 2020 年 6 月 15 日 16:59 | #22
  23. 2020 年 6 月 17 日 05:08 | #23
  24. 2020 年 6 月 17 日 07:08 | #24
  25. 2020 年 6 月 17 日 08:23 | #25
  26. 2020 年 6 月 17 日 09:20 | #26
  27. 2020 年 6 月 17 日 09:30 | #27
  28. 2020 年 6 月 17 日 11:18 | #28
  29. 2020 年 6 月 17 日 11:25 | #29
  30. 2020 年 6 月 17 日 12:57 | #30
  31. 2020 年 6 月 17 日 14:03 | #31
  32. 2020 年 6 月 17 日 17:16 | #32
  33. 2020 年 6 月 17 日 17:32 | #33
  34. 2020 年 6 月 17 日 19:27 | #34
  35. 2020 年 6 月 18 日 17:14 | #35
  36. 2020 年 6 月 19 日 17:14 | #36
  37. 2020 年 6 月 24 日 06:52 | #37
  38. 2020 年 6 月 25 日 07:04 | #38
  39. 2020 年 6 月 26 日 16:29 | #39
  40. 2020 年 6 月 28 日 07:55 | #40
  41. 2020 年 6 月 30 日 22:40 | #41
  42. 2020 年 7 月 1 日 16:28 | #42
  43. 2020 年 7 月 1 日 17:01 | #43
  44. 2020 年 7 月 1 日 23:32 | #44
  45. 2020 年 7 月 2 日 16:28 | #45
  46. 2020 年 7 月 2 日 16:42 | #46
  47. 2020 年 7 月 2 日 20:43 | #47
  48. 2020 年 7 月 3 日 17:09 | #48
  49. 2020 年 7 月 3 日 17:37 | #49
  50. 2020 年 7 月 3 日 21:02 | #50
  51. 2020 年 7 月 5 日 19:49 | #51
  52. 2020 年 7 月 5 日 20:56 | #52
  53. 2020 年 7 月 5 日 21:33 | #53