This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Calcula', function() { | |
it('deve somar DOIS números', function() { | |
var calcula = new Calcula(), | |
a = 2, | |
b = 6; | |
expect(calcula.soma(a, b)).toEqual(a+b); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.4.1/jasmine_favicon.png"> | |
<link rel="stylesheet" href="lib/jasmine-2.4.1/jasmine.css"> | |
<script src="lib/jasmine-2.4.1/jasmine.js"></script> | |
<script src="lib/jasmine-2.4.1/jasmine-html.js"></script> | |
<script src="lib/jasmine-2.4.1/boot.js"></script> | |
<!-- include source files here... --> | |
<script src="src/Calcula.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Calculadora', function() { | |
var calculadora, | |
a, | |
b; | |
//Inicia as variáveis antes de executar qualquer rotina de teste | |
beforeEach(function() { | |
calculadora = new Calculadora(); | |
a = 5; | |
b = 6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculadora { | |
soma(a, b) { | |
let result = a + b; | |
// Verifica se o resultado da soma convertido em inteiro não é igual ao resultado | |
// se isso for verdade, convertemos o número para float e limitamos o mesmo | |
// para apenas duas casas depois da vírgula | |
if (parseInt(result) != result) { | |
result = parseFloat(result.toFixed(2)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Calculadora', function() { | |
... | |
// Teste responsável pela verificação do erro quando | |
// existe Strings como parâmetros | |
it('deve gerar um ERRO ao receber uma String como parâmetro', function() { | |
expect(function() { | |
calculadora.soma(2, 'teste') | |
}).toThrowError(Error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculadora { | |
soma(a, b) { | |
let result; | |
// Verifica se os tipos dos arguentos que recebemos | |
// são do tipo 'number'. Caso não forem, iremos retornar um erro | |
if (typeof a != 'number' || typeof b != 'number') { | |
throw new Error("Os valores devem ser apenas números"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
... | |
dependencies { | |
compile 'com.google.android.gms:play-services:9.0.0' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create a group to grant select permission | |
CREATE ROLE readaccess; | |
-- Grant access to existing tables | |
GRANT USAGE ON SCHEMA public TO readaccess; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
-- Grant access to future tables | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
set encoding=utf-8 | |
set cursorline " Enable highlight current line | |
set colorcolumn=120 " Color column 120 | |
set laststatus=2 " Always show status bar | |
set noshowcmd " Hide typed command at statusbar | |
set noswapfile " Disable swp file | |
set relativenumber " Show relative line numbers | |
filetype off " required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew tap caskroom/versions | |
brew update | |
# --- DEVELOPMENT TOOLS | |
# Install git-flow |
OlderNewer