Q:

How to write simple Ruby wrapper for SQL methods to make this specs pass?

I have
describe SQL do
  it "generates select * when from given" do
    SQL.from('tname').generate.should == 'select * from tname;'
  end
end

I would like write implementation for from and generate methods for SQL class.

A:

a real naive implementation of the above (assuming it is not derived from ActiveRecord) would be something like this. 
class SQL
  def self.from(tname)
    SQL.new(tname)
  end

  def initialize(tname=nil)
    @tname = tname
  end

  def generate
    "Select * from #{@tname};"
  end
end

That will make your spec pass, but probably isn't want you actually want to do.

