Sha256: c7321409cc276253fc542ad88c454f944dedbde7d50f220f3c6e8a5fe169a7b5

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 Bytes

Contents

require 'spec_helper'

describe "the 'person' namespace example" do
  class Person
    attr_reader :first_name
    def initialize
      @first_name = "Colin"
    end
  end
  
  class MyConsole < Rink::Console
    option :namespace => Person.new
  end
  
  subject { MyConsole.new(:input => StringIO.new(""), :output => StringIO.new("")) }
  
  it "should autocomplete properly" do
    subject.send(:autocomplete, "firs").should == ['first_name']
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rink-1.0.2 spec/lib/documentation/person_namespace_spec.rb