mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-17 07:53:20 -04:00
Change EdgeCase to Neo
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutArrayAssignment < EdgeCase::Koan
|
class AboutArrayAssignment < Neo::Koan
|
||||||
def test_non_parallel_assignment
|
def test_non_parallel_assignment
|
||||||
names = ["John", "Smith"]
|
names = ["John", "Smith"]
|
||||||
assert_equal __(["John", "Smith"]), names
|
assert_equal __(["John", "Smith"]), names
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutArrays < EdgeCase::Koan
|
class AboutArrays < Neo::Koan
|
||||||
def test_creating_arrays
|
def test_creating_arrays
|
||||||
empty_array = Array.new
|
empty_array = Array.new
|
||||||
assert_equal __(Array), empty_array.class
|
assert_equal __(Array), empty_array.class
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
# -*- ruby -*-
|
# -*- ruby -*-
|
||||||
|
|
||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutAsserts < EdgeCase::Koan
|
class AboutAsserts < Neo::Koan
|
||||||
|
|
||||||
# We shall contemplate truth by testing reality, via asserts.
|
# We shall contemplate truth by testing reality, via asserts.
|
||||||
def test_assert_truth
|
def test_assert_truth
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutBlocks < EdgeCase::Koan
|
class AboutBlocks < Neo::Koan
|
||||||
def method_with_block
|
def method_with_block
|
||||||
result = yield
|
result = yield
|
||||||
result
|
result
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutClassMethods < EdgeCase::Koan
|
class AboutClassMethods < Neo::Koan
|
||||||
class Dog
|
class Dog
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutClasses < EdgeCase::Koan
|
class AboutClasses < Neo::Koan
|
||||||
class Dog
|
class Dog
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
C = "top level"
|
C = "top level"
|
||||||
|
|
||||||
class AboutConstants < EdgeCase::Koan
|
class AboutConstants < Neo::Koan
|
||||||
|
|
||||||
C = "nested"
|
C = "nested"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutControlStatements < EdgeCase::Koan
|
class AboutControlStatements < Neo::Koan
|
||||||
|
|
||||||
def test_if_then_else_statements
|
def test_if_then_else_statements
|
||||||
if true
|
if true
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
# Implement a DiceSet Class here:
|
# Implement a DiceSet Class here:
|
||||||
#
|
#
|
||||||
@@ -15,7 +15,7 @@ class DiceSet
|
|||||||
end
|
end
|
||||||
|
|
||||||
#++
|
#++
|
||||||
class AboutDiceProject < EdgeCase::Koan
|
class AboutDiceProject < Neo::Koan
|
||||||
def test_can_create_a_dice_set
|
def test_can_create_a_dice_set
|
||||||
dice = DiceSet.new
|
dice = DiceSet.new
|
||||||
assert_not_nil dice
|
assert_not_nil dice
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutExceptions < EdgeCase::Koan
|
class AboutExceptions < Neo::Koan
|
||||||
|
|
||||||
class MySpecialError < RuntimeError
|
class MySpecialError < RuntimeError
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutHashes < EdgeCase::Koan
|
class AboutHashes < Neo::Koan
|
||||||
def test_creating_hashes
|
def test_creating_hashes
|
||||||
empty_hash = Hash.new
|
empty_hash = Hash.new
|
||||||
assert_equal __(Hash), empty_hash.class
|
assert_equal __(Hash), empty_hash.class
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutInheritance < EdgeCase::Koan
|
class AboutInheritance < Neo::Koan
|
||||||
class Dog
|
class Dog
|
||||||
attr_reader :name
|
attr_reader :name
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutIteration < EdgeCase::Koan
|
class AboutIteration < Neo::Koan
|
||||||
|
|
||||||
# -- An Aside ------------------------------------------------------
|
# -- An Aside ------------------------------------------------------
|
||||||
# Ruby 1.8 stores names as strings. Ruby 1.9 stores names as
|
# Ruby 1.8 stores names as strings. Ruby 1.9 stores names as
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
include Java
|
include Java
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ include Java
|
|||||||
# * Calling custom java class
|
# * Calling custom java class
|
||||||
# * Calling Ruby from java???
|
# * Calling Ruby from java???
|
||||||
|
|
||||||
class AboutJavaInterop < EdgeCase::Koan
|
class AboutJavaInterop < Neo::Koan
|
||||||
def test_using_a_java_library_class
|
def test_using_a_java_library_class
|
||||||
java_array = java.util.ArrayList.new
|
java_array = java.util.ArrayList.new
|
||||||
assert_equal __(Java::JavaUtil::ArrayList), java_array.class
|
assert_equal __(Java::JavaUtil::ArrayList), java_array.class
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutMethods < EdgeCase::Koan
|
class AboutMethods < Neo::Koan
|
||||||
|
|
||||||
def method_with_keyword_arguments(one: 1, two: 'two')
|
def method_with_keyword_arguments(one: 1, two: 'two')
|
||||||
[one, two]
|
[one, two]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutMessagePassing < EdgeCase::Koan
|
class AboutMessagePassing < Neo::Koan
|
||||||
|
|
||||||
class MessageCatcher
|
class MessageCatcher
|
||||||
def caught?
|
def caught?
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
def my_global_method(a,b)
|
def my_global_method(a,b)
|
||||||
a + b
|
a + b
|
||||||
end
|
end
|
||||||
|
|
||||||
class AboutMethods < EdgeCase::Koan
|
class AboutMethods < Neo::Koan
|
||||||
|
|
||||||
def test_calling_global_methods
|
def test_calling_global_methods
|
||||||
assert_equal __(5), my_global_method(2,3)
|
assert_equal __(5), my_global_method(2,3)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutModules < EdgeCase::Koan
|
class AboutModules < Neo::Koan
|
||||||
module Nameable
|
module Nameable
|
||||||
def set_name(new_name)
|
def set_name(new_name)
|
||||||
@name = new_name
|
@name = new_name
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutNil < EdgeCase::Koan
|
class AboutNil < Neo::Koan
|
||||||
def test_nil_is_an_object
|
def test_nil_is_an_object
|
||||||
assert_equal __(true), nil.is_a?(Object), "Unlike NULL in other languages"
|
assert_equal __(true), nil.is_a?(Object), "Unlike NULL in other languages"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutObjects < EdgeCase::Koan
|
class AboutObjects < Neo::Koan
|
||||||
def test_everything_is_an_object
|
def test_everything_is_an_object
|
||||||
assert_equal __(true), 1.is_a?(Object)
|
assert_equal __(true), 1.is_a?(Object)
|
||||||
assert_equal __(true), 1.5.is_a?(Object)
|
assert_equal __(true), 1.5.is_a?(Object)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutOpenClasses < EdgeCase::Koan
|
class AboutOpenClasses < Neo::Koan
|
||||||
class Dog
|
class Dog
|
||||||
def bark
|
def bark
|
||||||
"WOOF"
|
"WOOF"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
# Project: Create a Proxy Class
|
# Project: Create a Proxy Class
|
||||||
#
|
#
|
||||||
@@ -42,7 +42,7 @@ end
|
|||||||
|
|
||||||
# The proxy object should pass the following Koan:
|
# The proxy object should pass the following Koan:
|
||||||
#
|
#
|
||||||
class AboutProxyObjectProject < EdgeCase::Koan
|
class AboutProxyObjectProject < Neo::Koan
|
||||||
def test_proxy_method_returns_wrapped_object
|
def test_proxy_method_returns_wrapped_object
|
||||||
# NOTE: The Television class is defined below
|
# NOTE: The Television class is defined below
|
||||||
tv = Proxy.new(Television.new)
|
tv = Proxy.new(Television.new)
|
||||||
@@ -135,7 +135,7 @@ class Television
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Tests for the Television class. All of theses tests should pass.
|
# Tests for the Television class. All of theses tests should pass.
|
||||||
class TelevisionTest < EdgeCase::Koan
|
class TelevisionTest < Neo::Koan
|
||||||
def test_it_turns_on
|
def test_it_turns_on
|
||||||
tv = Television.new
|
tv = Television.new
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutRegularExpressions < EdgeCase::Koan
|
class AboutRegularExpressions < Neo::Koan
|
||||||
def test_a_pattern_is_a_regular_expression
|
def test_a_pattern_is_a_regular_expression
|
||||||
assert_equal __(Regexp), /pattern/.class
|
assert_equal __(Regexp), /pattern/.class
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutSandwichCode < EdgeCase::Koan
|
class AboutSandwichCode < Neo::Koan
|
||||||
|
|
||||||
def count_lines(file_name)
|
def count_lines(file_name)
|
||||||
file = open(file_name)
|
file = open(file_name)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutScope < EdgeCase::Koan
|
class AboutScope < Neo::Koan
|
||||||
module Jims
|
module Jims
|
||||||
class Dog
|
class Dog
|
||||||
def identify
|
def identify
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
# Greed is a dice game where you roll up to five dice to accumulate
|
# Greed is a dice game where you roll up to five dice to accumulate
|
||||||
# points. The following "score" function will be used to calculate the
|
# points. The following "score" function will be used to calculate the
|
||||||
@@ -54,7 +54,7 @@ def score(dice)
|
|||||||
#++
|
#++
|
||||||
end
|
end
|
||||||
|
|
||||||
class AboutScoringProject < EdgeCase::Koan
|
class AboutScoringProject < Neo::Koan
|
||||||
def test_score_of_an_empty_list_is_zero
|
def test_score_of_an_empty_list_is_zero
|
||||||
assert_equal 0, score([])
|
assert_equal 0, score([])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutStrings < EdgeCase::Koan
|
class AboutStrings < Neo::Koan
|
||||||
def test_double_quoted_strings_are_strings
|
def test_double_quoted_strings_are_strings
|
||||||
string = "Hello, World"
|
string = "Hello, World"
|
||||||
assert_equal __(true), string.is_a?(String)
|
assert_equal __(true), string.is_a?(String)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutSymbols < EdgeCase::Koan
|
class AboutSymbols < Neo::Koan
|
||||||
def test_symbols_are_symbols
|
def test_symbols_are_symbols
|
||||||
symbol = :ruby
|
symbol = :ruby
|
||||||
assert_equal __(true), symbol.is_a?(Symbol)
|
assert_equal __(true), symbol.is_a?(Symbol)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutToStr < EdgeCase::Koan
|
class AboutToStr < Neo::Koan
|
||||||
|
|
||||||
class CanNotBeTreatedAsString
|
class CanNotBeTreatedAsString
|
||||||
def to_s
|
def to_s
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
# You need to write the triangle method in the file 'triangle.rb'
|
# You need to write the triangle method in the file 'triangle.rb'
|
||||||
require 'triangle.rb'
|
require 'triangle.rb'
|
||||||
|
|
||||||
class AboutTriangleProject < EdgeCase::Koan
|
class AboutTriangleProject < Neo::Koan
|
||||||
def test_equilateral_triangles_have_equal_sides
|
def test_equilateral_triangles_have_equal_sides
|
||||||
assert_equal :equilateral, triangle(2, 2, 2)
|
assert_equal :equilateral, triangle(2, 2, 2)
|
||||||
assert_equal :equilateral, triangle(10, 10, 10)
|
assert_equal :equilateral, triangle(10, 10, 10)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
# You need to write the triangle method in the file 'triangle.rb'
|
# You need to write the triangle method in the file 'triangle.rb'
|
||||||
require 'triangle.rb'
|
require 'triangle.rb'
|
||||||
|
|
||||||
class AboutTriangleProject2 < EdgeCase::Koan
|
class AboutTriangleProject2 < Neo::Koan
|
||||||
# The first assignment did not talk about how to handle errors.
|
# The first assignment did not talk about how to handle errors.
|
||||||
# Let's handle that part now.
|
# Let's handle that part now.
|
||||||
def test_illegal_triangles_throw_exceptions
|
def test_illegal_triangles_throw_exceptions
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require File.expand_path(File.dirname(__FILE__) + '/edgecase')
|
require File.expand_path(File.dirname(__FILE__) + '/neo')
|
||||||
|
|
||||||
class AboutTrueAndFalse < EdgeCase::Koan
|
class AboutTrueAndFalse < Neo::Koan
|
||||||
def truth_value(condition)
|
def truth_value(condition)
|
||||||
if condition
|
if condition
|
||||||
:true_stuff
|
:true_stuff
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ class String
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: Change EdgeCase to Neo
|
module Neo
|
||||||
module EdgeCase
|
|
||||||
class << self
|
class << self
|
||||||
def simple_output
|
def simple_output
|
||||||
ENV['SIMPLE_KOAN_OUTPUT'] == 'true'
|
ENV['SIMPLE_KOAN_OUTPUT'] == 'true'
|
||||||
@@ -196,7 +195,7 @@ module EdgeCase
|
|||||||
@failure = step.failure
|
@failure = step.failure
|
||||||
add_progress(@pass_count)
|
add_progress(@pass_count)
|
||||||
@observations << Color.red("#{step.koan_file}##{step.name} has damaged your karma.")
|
@observations << Color.red("#{step.koan_file}##{step.name} has damaged your karma.")
|
||||||
throw :edgecase_exit
|
throw :neo_exit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -222,7 +221,7 @@ module EdgeCase
|
|||||||
|
|
||||||
def show_progress
|
def show_progress
|
||||||
bar_width = 50
|
bar_width = 50
|
||||||
total_tests = EdgeCase::Koan.total_tests
|
total_tests = Neo::Koan.total_tests
|
||||||
scale = bar_width.to_f/total_tests
|
scale = bar_width.to_f/total_tests
|
||||||
print Color.green("your path thus far [")
|
print Color.green("your path thus far [")
|
||||||
happy_steps = (pass_count*scale).to_i
|
happy_steps = (pass_count*scale).to_i
|
||||||
@@ -238,7 +237,7 @@ module EdgeCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def end_screen
|
def end_screen
|
||||||
if EdgeCase.simple_output
|
if Neo.simple_output
|
||||||
boring_end_screen
|
boring_end_screen
|
||||||
else
|
else
|
||||||
artistic_end_screen
|
artistic_end_screen
|
||||||
@@ -275,7 +274,7 @@ module EdgeCase
|
|||||||
,:::::::::::::, brought to you by ,,::::::::::::,
|
,:::::::::::::, brought to you by ,,::::::::::::,
|
||||||
:::::::::::::: ,::::::::::::
|
:::::::::::::: ,::::::::::::
|
||||||
::::::::::::::, ,:::::::::::::
|
::::::::::::::, ,:::::::::::::
|
||||||
::::::::::::, EdgeCase Software Artisans , ::::::::::::
|
::::::::::::, Neo Software Artisans , ::::::::::::
|
||||||
:,::::::::: :::: :::::::::::::
|
:,::::::::: :::: :::::::::::::
|
||||||
,::::::::::: ,: ,,:::::::::::::,
|
,::::::::::: ,: ,,:::::::::::::,
|
||||||
:::::::::::: ,::::::::::::::,
|
:::::::::::: ,::::::::::::::,
|
||||||
@@ -337,7 +336,7 @@ ENDTEXT
|
|||||||
|
|
||||||
def find_interesting_lines(backtrace)
|
def find_interesting_lines(backtrace)
|
||||||
backtrace.reject { |line|
|
backtrace.reject { |line|
|
||||||
line =~ /test\/unit\/|edgecase\.rb|minitest/
|
line =~ /test\/unit\/|neo\.rb|minitest/
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -397,19 +396,19 @@ ENDTEXT
|
|||||||
setup
|
setup
|
||||||
begin
|
begin
|
||||||
send(name)
|
send(name)
|
||||||
rescue StandardError, EdgeCase::Sensei::AssertionError => ex
|
rescue StandardError, Neo::Sensei::AssertionError => ex
|
||||||
failed(ex)
|
failed(ex)
|
||||||
ensure
|
ensure
|
||||||
begin
|
begin
|
||||||
teardown
|
teardown
|
||||||
rescue StandardError, EdgeCase::Sensei::AssertionError => ex
|
rescue StandardError, Neo::Sensei::AssertionError => ex
|
||||||
failed(ex) if passed?
|
failed(ex) if passed?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
# Class methods for the EdgeCase test suite.
|
# Class methods for the Neo test suite.
|
||||||
class << self
|
class << self
|
||||||
def inherited(subclass)
|
def inherited(subclass)
|
||||||
subclasses << subclass
|
subclasses << subclass
|
||||||
@@ -466,7 +465,7 @@ ENDTEXT
|
|||||||
|
|
||||||
class ThePath
|
class ThePath
|
||||||
def walk
|
def walk
|
||||||
sensei = EdgeCase::Sensei.new
|
sensei = Neo::Sensei.new
|
||||||
each_step do |step|
|
each_step do |step|
|
||||||
sensei.observe(step.meditate)
|
sensei.observe(step.meditate)
|
||||||
end
|
end
|
||||||
@@ -474,9 +473,9 @@ ENDTEXT
|
|||||||
end
|
end
|
||||||
|
|
||||||
def each_step
|
def each_step
|
||||||
catch(:edgecase_exit) {
|
catch(:neo_exit) {
|
||||||
step_count = 0
|
step_count = 0
|
||||||
EdgeCase::Koan.subclasses.each_with_index do |koan,koan_index|
|
Neo::Koan.subclasses.each_with_index do |koan,koan_index|
|
||||||
koan.testmethods.each do |method_name|
|
koan.testmethods.each do |method_name|
|
||||||
step = koan.new(method_name, koan.to_s, koan_index+1, step_count+=1)
|
step = koan.new(method_name, koan.to_s, koan_index+1, step_count+=1)
|
||||||
yield step
|
yield step
|
||||||
@@ -488,6 +487,6 @@ ENDTEXT
|
|||||||
end
|
end
|
||||||
|
|
||||||
END {
|
END {
|
||||||
EdgeCase::Koan.command_line(ARGV)
|
Neo::Koan.command_line(ARGV)
|
||||||
EdgeCase::ThePath.new.walk
|
Neo::ThePath.new.walk
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user