<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ganmacs</author_name>
  <author_url>https://blog.hatena.ne.jp/ganmacs/</author_url>
  <blog_title>memo-mode</blog_title>
  <blog_url>https://ganmacs.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>RSpec</anon>
  </categories>
  <description>rspecで標準入力からユーザの入力を受け取って標準出力に出力する方法の覚書 rspec2とrspec3がまざっててややこしかった プロダクションコード solver.rb getでユーザの入力を受け取ってprintで標準出力に答え(文字列)を出力するのクラス class Solver attr_reader :n def get @n = gets end def print puts 'answer is foo' end end テストコード solver_spec.rb 標準入力ではallow(ARGF).to receive(:gets) { 1000 }とするといいらしい． 100…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fganmacs.hatenablog.com%2Fentry%2F2014%2F07%2F26%2F231607&quot; title=&quot;rspec3で標準入力と標準出力のテスト - memo-mode&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-07-26 23:16:07</published>
  <title>rspec3で標準入力と標準出力のテスト</title>
  <type>rich</type>
  <url>https://ganmacs.hatenablog.com/entry/2014/07/26/231607</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
