Skip to content

Instantly share code, notes, and snippets.

View edipofederle's full-sized avatar
🏠
Working from home

Édipo Féderle edipofederle

🏠
Working from home
View GitHub Profile
require 'spec_helper'
describe User do
it "should be invalid wihout name" do
user = User.create(:name => nil)
user.errors.should be_invalid(:name)
end
it "should have minimum 5 characteres" do
deploy.application = "inploy"
deploy.repository = 'git://github.com/dcrec1/inploy.git'
deploy.user = 'dcrec1'
deploy.hosts = ['hooters', 'geni']
deploy.path = '/var/local/apps'
# optional advanced settings
# deploy.ssh_opts = '-A'
# deploy.branch = 'master'
deploy.template = :locaweb
deploy.application = "nome_da_aplicacao"
deploy.user = 'seu_usuario'
deploy.hosts = ['seusite.com']
require File.dirname(__FILE__) + '/../spec_helper'
module ProjectSpecHelper
def valid_project_attributes
{ :name => 'app_test',
:url => 'git://my_app',
:email => '[email protected]' }
end
def invalid_project_attributes
Net::SSH.start( hostname, username, :password => password ) do |ssh|
puts "Gerando Backup"
ssh.exec("mysqldump --host=#{host} --user=#{user} --password=#{pass} --database #{database} > dump.sql")
begin
raise "Excecao" unless File.exist?('dump.sql', ".")
rescue ArgumentError => error
puts "Algo errado aconteceu"
rescue RuntimeError => error
puts "Arquivo dump.sql nao foi encontado. #{error}"
else
require 'net/ssh'
require 'fileutils'
class MinhaGem
VERSION = '0.0.1'
def initialize(server, user, pass)
@server = server
@user = user
class Matematica
end
class Matematica
self # retorna Matematica
end
mat = Matematica.new
mat.class # -> Matematica
mat.is_a? Matematica # -> true