tests for CustomRefactoringClassGenerator
authorJakub Nesveda <jakubnesveda@seznam.cz>
Sun, 09 Nov 2014 01:12:04 +0100
changeset 737 dbbad959994f
parent 736 cbb808f1f9ff
child 738 3c27b65f02bf
tests for CustomRefactoringClassGenerator fix typo in CustomRefactoringClassGenerator
CustomRefactoringClassGenerator.st
CustomRefactoringClassGeneratorTests.st
abbrev.stc
jn_refactoring_custom.st
patches/patches.rc
refactoring_custom.rc
--- a/CustomRefactoringClassGenerator.st	Sun Nov 09 01:01:32 2014 +0100
+++ b/CustomRefactoringClassGenerator.st	Sun Nov 09 01:12:04 2014 +0100
@@ -11,9 +11,9 @@
 
 description
 
-    ^ 'Create new class which should perfomrm some refactoring'
+    ^ 'Create new class which should perform some refactoring'
 
-    "Modified: / 08-11-2014 / 17:20:55 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+    "Modified: / 09-11-2014 / 00:51:47 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
 !
 
 group
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CustomRefactoringClassGeneratorTests.st	Sun Nov 09 01:12:04 2014 +0100
@@ -0,0 +1,37 @@
+"{ Package: 'jn:refactoring_custom' }"
+
+CustomCodeGeneratorOrRefactoringTestCase subclass:#CustomRefactoringClassGeneratorTests
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Refactoring-Custom-Generators-Tests'
+!
+
+!CustomRefactoringClassGeneratorTests methodsFor:'accessing'!
+
+generatorOrRefactoring
+    ^ CustomRefactoringClassGenerator new
+! !
+
+!CustomRefactoringClassGeneratorTests methodsFor:'tests'!
+
+test_refactoring_subclass_created
+    | expectedSource class |
+
+    expectedSource := 'buildInContext:aCustomContext
+    self shouldImplement'.
+
+    generatorOrRefactoring
+        newClassName: #DummyClass01;  
+        executeInContext: context.  
+
+    self assertClassExists: #DummyClass01.  
+
+    class := Smalltalk at: #DummyClass01.
+
+    self assertMethodSource:expectedSource atSelector:#buildInContext: forClass: class.  
+    self assert: (class superclass name) = #CustomRefactoring.
+
+    "Created: / 09-11-2014 / 01:04:37 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
+! !
+
--- a/abbrev.stc	Sun Nov 09 01:01:32 2014 +0100
+++ b/abbrev.stc	Sun Nov 09 01:12:04 2014 +0100
@@ -59,6 +59,7 @@
 CustomNoneSourceCodeFormatter CustomNoneSourceCodeFormatter jn:refactoring_custom 'Interface-Refactoring-Custom' 0
 CustomRBLocalSourceCodeFormatter CustomRBLocalSourceCodeFormatter jn:refactoring_custom 'Interface-Refactoring-Custom' 0
 CustomRefactoring CustomRefactoring jn:refactoring_custom 'Interface-Refactoring-Custom-Refactorings' 0
+CustomRefactoringClassGeneratorTests CustomRefactoringClassGeneratorTests jn:refactoring_custom 'Interface-Refactoring-Custom-Generators-Tests' 1
 CustomRefactoryBuilderTests CustomRefactoryBuilderTests jn:refactoring_custom 'Interface-Refactoring-Custom-Tests' 1
 CustomReplaceIfNilWithIfTrueRefactoringTests CustomReplaceIfNilWithIfTrueRefactoringTests jn:refactoring_custom 'Interface-Refactoring-Custom-Refactorings-Tests' 1
 CustomSilentDialog CustomSilentDialog jn:refactoring_custom 'Interface-Refactoring-Custom' 0
--- a/jn_refactoring_custom.st	Sun Nov 09 01:01:32 2014 +0100
+++ b/jn_refactoring_custom.st	Sun Nov 09 01:12:04 2014 +0100
@@ -152,6 +152,7 @@
         CustomNoneSourceCodeFormatter
         CustomRBLocalSourceCodeFormatter
         CustomRefactoring
+        (CustomRefactoringClassGeneratorTests autoload)
         (CustomRefactoryBuilderTests autoload)
         (CustomReplaceIfNilWithIfTrueRefactoringTests autoload)
         CustomSilentDialog
--- a/patches/patches.rc	Sun Nov 09 01:01:32 2014 +0100
+++ b/patches/patches.rc	Sun Nov 09 01:12:04 2014 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
       VALUE "ProductName", "LibraryName\0"
       VALUE "ProductVersion", "6.2.4.1420\0"
-      VALUE "ProductDate", "Sun, 09 Nov 2014 00:00:40 GMT\0"
+      VALUE "ProductDate", "Sun, 09 Nov 2014 00:11:22 GMT\0"
     END
 
   END
--- a/refactoring_custom.rc	Sun Nov 09 01:01:32 2014 +0100
+++ b/refactoring_custom.rc	Sun Nov 09 01:12:04 2014 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
       VALUE "ProductName", "ProductName\0"
       VALUE "ProductVersion", "6.2.4.1420\0"
-      VALUE "ProductDate", "Sun, 09 Nov 2014 00:00:37 GMT\0"
+      VALUE "ProductDate", "Sun, 09 Nov 2014 00:11:19 GMT\0"
     END
 
   END