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
<?php | |
// For composer | |
require_once 'vendor/autoload.php'; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit | |
bootstrap="./tests/phpunit.bootstrap.php" | |
processIsolation="false" | |
verbose="true" | |
strict="false" | |
colors="true"> | |
<testsuites> | |
<testsuite name="PHPUnit"> | |
<directory>./tests</directory> |
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
# isbn is isbn13 | |
def to_isbn10(isbn) | |
digits = isbn.slice(3,9).split("") | |
sum = 0 | |
(0..9).each do |i| | |
sum += digits[i].to_i * (10 - i) | |
end | |
chk_tmp = 11 - (sum % 11) |
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
import mockit.Mock; | |
import mockit.MockUp; | |
import org.junit.Before; | |
import org.junit.Test; | |
private TestTarget target; | |
/* | |
複数のテストから呼び出せるようにメソッドとして書きました。 |
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
MyCollection = Backbone.Collection.extend({ | |
model:MyModel, | |
url: "/mymodels", | |
fetchPerCategory: function (categoryId, options) { | |
options = options || {}; |
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
$ rvm install jruby | |
$ rvm default jruby | |
$ jruby -S gem install rails rspec rspec-rails | |
Successfully installed activesupport-3.0.3 | |
Successfully installed builder-2.1.2 | |
Successfully installed i18n-0.4.2 | |
Successfully installed activemodel-3.0.3 | |
... | |
$ jruby -S rails new jrubyapp |