This file contains hidden or 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("Jasmine", function() { | |
it("makes testing JavaScript awesome!", function() { | |
expect(yourCode).toBeLotsBetter(); | |
}); | |
}); |
This file contains hidden or 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('Array クラスは', function() { | |
it('length プロパティで配列長を取得する事ができる', function() { | |
var arr = [1, 2, 3]; | |
expect(arr.length).toEqual(3); | |
}); | |
}); |
This file contains hidden or 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Jasmine Test Runner</title> | |
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.0.1/jasmine.css"> | |
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine.js"></script> | |
<script type="text/javascript" src="lib/jasmine-1.0.1/jasmine-html.js"></script> | |
<!-- include spec files here... --> |
This file contains hidden or 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
# src_files | |
# | |
# Return an array of filepaths relative to src_dir to include before jasmine specs. | |
# Default: [] | |
# | |
# EXAMPLE: | |
# | |
# src_files: | |
# - lib/source1.js | |
# - lib/source2.js |
This file contains hidden or 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
require 'rest_client' | |
require 'nokogiri' | |
resource = RestClient::Resource.new('https://api.heroku.com', 'USERNAME', 'PASSWORD') | |
args = [:get, nil, { | |
'X-Heroku-API-Version' => '2', | |
'User-Agent' => 'my heroku client/1.0', | |
'X-Ruby-Version' => RUBY_VERSION, | |
'X-Ruby-Platform' => RUBY_PLATFORM | |
}].compact |
This file contains hidden or 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
/** | |
* Array クラスのテスト | |
*/ | |
describe('Array クラスは', function() { | |
var arr = null; | |
beforeEach(function() { | |
arr = [1, 2, 3]; | |
}); |
This file contains hidden or 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
/** | |
* Array クラスのテスト | |
*/ | |
describe("Array クラスは", function() { | |
var arr = null; | |
beforeEach(function() { | |
arr = [1, 2, 3]; | |
}); |
This file contains hidden or 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
/** | |
* Document クラスのテスト | |
*/ | |
describe('Document オブジェクトは', function() { | |
it('getElementById メソッドで特定の ID を持つ DOM オブジェクトを取得する事ができる', function() { | |
var elementId = 'test-node'; | |
expect(document.getElementById(elementId)).not.toBeNull(); | |
}); | |
}); |
This file contains hidden or 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
# Forked to get it working with Rails 3 and RSpec 2 | |
# | |
# From http://github.com/jaymcgavren | |
# | |
# Save this as rcov.rake in lib/tasks and use rcov:all => | |
# to get accurate spec/feature coverage data | |
# | |
# Use rcov:rspec or rcov:steak | |
# to get non-aggregated coverage reports for rspec or steak separately |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'time' | |
pattern = /^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}-\d{2}:\d{2}) (.+)$/ | |
ARGF.each { |line| puts "#{Time.parse($1)} #{$2}" if line =~ pattern } |