Creating a dictionary
class Dictionary
    attr_accessor :entries


Indentation in Ruby is two spaces, not four. You have that correct in your specs, but not in the application code.

Also, you create here a pair of methods, entries= which you never use anywhere, and entries, which you overwrite further down, anyway. Either get rid of this line, or (preferred!) actually make use of those methods.

    def initialize
        @hash={}


There should be a space on both sides of the = sign. This applies to operators in general.

[Note: there are some style guides that advocate not using spaces around the = sign for optional parameters with default arguments, but a) this is not universally accepted and b) not the case here anyway.]

    end

    def add(a)


This should probably be called &lt;&lt; instead.

[Note: I realize, this is prescribed by the spec. IMO, the spec should be changed.]

        if a.class == Hash


You should never compare the class of an object like this. Ideally, you should use runtime ad-hoc polymorphism. If that isn't possible, at least use Object#is_a?, Object#kind_of?, or Module#===.

            a.each_pair { |k, v|
                @hash[k]=v
            }


There are two different camps when it comes to block styles: one camp says to use {/} for one-liners and do/end for multiple lines. The other camp says to use {/} for "functional" blocks and do/end for side-effecting blocks.

Regardless of which camp you follow: your block has three lines and side-effects, so it should use the keyword form.

        else
           @hash[a]=nil 
       end
    end


There should be an empty between the two method definitions.

    def entries
        @hash
    end

    def keywords
        @hash.keys.sort
    end
    def include?(k)
        @hash.key?(k)
    end

    def printable


This should be called to_s. to_s is the standard name for a method that converts an object into a textual representation. It is used automatically by methods such as Array#join or Kernel#puts.

[Note: I realize, this is prescribed by the spec. IMO, the spec should be changed.]

        str=[]
        key=@hash.keys.sort
        key.each do |el|
            @hash.each_pair do |k,v|
                if k==el
                    str &lt;&lt; "[#{k}] \"#{v}\""


You could save yourself some hassle here by using something else than " to delimit the string.

This pattern, where you initialize an accumulator to an "empty" value and then iterate over a collection while appending to the accumulator at every iteration, is called a Catamorphism, fold, or reduce. In Ruby, it is known as inject.

However, in this case, it can also be done even simpler, with a map.

                end
            end
        end
        return str.join("\n")


The return is superfluous here, the return value of a method is the value of the last expression which is evaluated inside the method body.

    end

    def find(str)
        if str.class == Hash
            str.each_pair { |k, v|
               return (@hash.select { |k,v| k.include?(k)})
            }


There is nothing in the spec about passing Hashes to find. In fact, you named your parameter str clearly indicating that you expect it to be a String. Then why even bother checking for Hashes?

        elsif str.class == String 
            return (@hash.select {|k,v| k.include?(str)})


Here you check whether the key includes the search string. However, from the documentation in the spec, it appears that the search string should be a prefix of the key. Unfortunately, there is actually no test in the spec to test for that distinction.

        end
    end
end


This is what it would look like with those suggestions applied:

class Dictionary
  attr_reader :entries

  def initialize
    self.entries = {}
  end

  def add(a)
    case a
    when Hash then entries.merge!(a)
    else           entries[a] = nil
    end
  end

  def keywords
    entries.keys.sort
  end

  def include?(k)
    entries.key?(k)
  end

  def printable
    entries.
      sort.
      map {|k, v| ["[#{k}]", unless v.nil? then %Q["#{v}"] end] }.
      map(&amp;:compact).
      map {|kvp| kvp.join(' ') }.
      join("\n")
  end

  def find(key)
    entries.select {|k, v| k.start_with?(key) }
  end

  private

  attr_writer :entries
end