summaryrefslogtreecommitdiff
path: root/spec/syntax_suggest/unit/mini_stringio_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/syntax_suggest/unit/mini_stringio_spec.rb')
-rw-r--r--spec/syntax_suggest/unit/mini_stringio_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/syntax_suggest/unit/mini_stringio_spec.rb b/spec/syntax_suggest/unit/mini_stringio_spec.rb
new file mode 100644
index 0000000000..75d94deae1
--- /dev/null
+++ b/spec/syntax_suggest/unit/mini_stringio_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require_relative "../spec_helper"
+
+module SyntaxSuggest
+ RSpec.describe "MiniStringIO" do
+ it "#puts with no inputs" do
+ io = MiniStringIO.new
+ io.puts
+ expect(io.string).to eq($/)
+ end
+
+ it "#puts with an input" do
+ io = MiniStringIO.new
+ io.puts "Hello"
+ expect(io.string).to eq(["Hello", $/].join)
+ end
+
+ it "#puts with an input with a newline" do
+ io = MiniStringIO.new
+ io.puts "Hello\n"
+ expect(io.string).to eq(["Hello\n", $/].join)
+ end
+ end
+end