Created
September 26, 2015 14:15
-
-
Save wanabe/e466b0b13595ded33ddf to your computer and use it in GitHub Desktop.
11551
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
| module Minitest | |
| def self.run | |
| [Minitest::Test, AcceptanceValidationTest].map { |suite| suite.run } | |
| end | |
| class Test | |
| def self.run | |
| public_instance_methods(true).grep(/^test_/).sort.each do |method_name| | |
| begin | |
| new.send(method_name) | |
| rescue Exception => e | |
| end | |
| end | |
| end | |
| end | |
| end | |
| class AcceptanceValidator | |
| def initialize | |
| Topic.include(Module.new do | |
| define_method(:method_missing) do |method_name, *args| | |
| hogehoge | |
| end | |
| end) | |
| end | |
| end | |
| class Topic | |
| def initialize(attributes = {}) | |
| attributes.each do |key, value| | |
| send "#{key}=", value | |
| end | |
| end | |
| end | |
| class AcceptanceValidationTest < ::Minitest::Test | |
| def test_terms_of_service_agreement_no_acceptance | |
| AcceptanceValidator.new | |
| Topic.new("title" => "We should not be confirmed") | |
| end | |
| def test_terms_of_service_agreement | |
| AcceptanceValidator.new | |
| Topic.new("title" => "We should be confirmed") | |
| end | |
| end | |
| p :begin | |
| begin | |
| Minitest.run | |
| ensure | |
| p :end | |
| end | |
| exit!(0) |
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
| #!/bin/bash | |
| COUNT=0 | |
| FAIL=(0 0) | |
| while :; do | |
| for i in 0 1; do | |
| rbenv local 2.2.$(( i + 2 )) | |
| ruby -I./lib -I./test -rrake/rake_test_loader.rb test/cases/validations/acceptance_validation_test.rb \ | |
| || eval 'FAIL['$i']=$(( ${FAIL['$i']} + 1 ))' | |
| COUNT=$(( COUNT + 1 )) | |
| echo ${FAIL[0]} "/" ${FAIL[1]} "/" $COUNT | |
| done | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment