Sha256: 4347befb7a74063ee3c5e8fc26aeefe7fb336ffe45b17603c6d1752147474667

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe Rink::IOMethods do
  include Rink::IOMethods
  
  shared_examples_for "an input method" do
    it "should gets" do
      inln = @input.gets
      inln.should_not be_nil
      inln.length.should_not == 0
    end
  end
  
  context "input should be set up" do
    context "from a File" do
      before(:each) { setup_input_method(File.new(__FILE__, "r")).should be_kind_of(Rink::InputMethod::Base) }
      
      it_should_behave_like "an input method"
    end
    
    context "from a String" do
      before(:each) { setup_input_method("a string").should be_kind_of(Rink::InputMethod::Base) }
      
      it_should_behave_like "an input method"
    end
    
    context "from a StringIO" do
      before(:each) { setup_input_method(StringIO.new("a string")).should be_kind_of(Rink::InputMethod::Base) }
      
      it_should_behave_like "an input method"
    end
    
    context "from an InputMethod" do
      before(:each) { setup_input_method(setup_input_method("a string")).should be_kind_of(Rink::InputMethod::Base) }
      
      it_should_behave_like "an input method"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rink-1.0.2 spec/lib/rink/io_methods_spec.rb
rink-1.0.1 spec/lib/rink/io_methods_spec.rb
rink-1.0.0 spec/lib/rink/io_methods_spec.rb