rcodetools 0.8.0.0 → 0.8.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/Rakefile +3 -3
  2. data/bin/rct-complete +1 -1
  3. data/bin/rct-doc +1 -1
  4. data/bin/rct-meth-args +1 -1
  5. data/bin/xmpfilter +1 -1
  6. data/lib/rcodetools/xmpfilter.rb +2 -2
  7. data/rcodetools.elc +0 -0
  8. data/rcodetools.gif +0 -0
  9. data/rcodetools.sxmp +0 -0
  10. data/test/attic/test_run.rb +45 -0
  11. data/test/data/attic/add_markers-input.rb +2 -0
  12. data/test/data/attic/add_markers-output.rb +2 -0
  13. data/test/data/attic/bindings-input.rb +26 -0
  14. data/test/data/attic/bindings-output.rb +31 -0
  15. data/test/data/attic/completion-input.rb +1 -0
  16. data/test/data/attic/completion-output.rb +2 -0
  17. data/test/data/attic/completion_class_info-input.rb +1 -0
  18. data/test/data/attic/completion_class_info-output.rb +10 -0
  19. data/test/data/attic/completion_class_info_no_candidates-input.rb +1 -0
  20. data/test/data/attic/completion_class_info_no_candidates-output.rb +1 -0
  21. data/test/data/attic/completion_detect_rbtest-input.rb +7 -0
  22. data/test/data/attic/completion_detect_rbtest-output.rb +2 -0
  23. data/test/data/attic/completion_detect_rbtest2-input.rb +1 -0
  24. data/test/data/attic/completion_detect_rbtest2-output.rb +2 -0
  25. data/test/data/attic/completion_emacs-input.rb +1 -0
  26. data/test/data/attic/completion_emacs-output.rb +6 -0
  27. data/test/data/attic/completion_emacs_icicles-input.rb +1 -0
  28. data/test/data/attic/completion_emacs_icicles-output.rb +6 -0
  29. data/test/data/attic/completion_in_method-input.rb +3 -0
  30. data/test/data/attic/completion_in_method-output.rb +1 -0
  31. data/test/data/attic/completion_in_method-test.rb +6 -0
  32. data/test/data/attic/completion_rbtest-input.rb +7 -0
  33. data/test/data/attic/completion_rbtest-output.rb +2 -0
  34. data/test/data/attic/doc-input.rb +1 -0
  35. data/test/data/attic/doc-output.rb +1 -0
  36. data/test/data/attic/doc_detect_rbtest-input.rb +1 -0
  37. data/test/data/attic/doc_detect_rbtest-output.rb +1 -0
  38. data/test/data/attic/doc_detect_rbtest2-input.rb +7 -0
  39. data/test/data/attic/doc_detect_rbtest2-output.rb +1 -0
  40. data/test/data/attic/doc_rbtest-input.rb +7 -0
  41. data/test/data/attic/doc_rbtest-output.rb +1 -0
  42. data/test/data/attic/no_warnings-input.rb +3 -0
  43. data/test/data/attic/no_warnings-output.rb +4 -0
  44. data/test/data/attic/refe-input.rb +1 -0
  45. data/test/data/attic/refe-output.rb +1 -0
  46. data/test/data/attic/ri-input.rb +1 -0
  47. data/test/data/attic/ri-output.rb +1 -0
  48. data/test/data/attic/ri_emacs-input.rb +1 -0
  49. data/test/data/attic/ri_emacs-output.rb +1 -0
  50. data/test/data/attic/ri_vim-input.rb +1 -0
  51. data/test/data/attic/ri_vim-output.rb +1 -0
  52. data/test/data/attic/rspec-input.rb +48 -0
  53. data/test/data/attic/rspec-output.rb +52 -0
  54. data/test/data/attic/rspec_poetry-input.rb +48 -0
  55. data/test/data/attic/rspec_poetry-output.rb +52 -0
  56. data/test/data/attic/simple_annotation-input.rb +8 -0
  57. data/test/data/attic/simple_annotation-output.rb +8 -0
  58. data/test/data/attic/unit_test-input.rb +50 -0
  59. data/test/data/attic/unit_test-output.rb +52 -0
  60. data/test/data/attic/unit_test_detect_rbtest-input.rb +50 -0
  61. data/test/data/attic/unit_test_detect_rbtest-output.rb +52 -0
  62. data/test/data/attic/unit_test_detect_rbtest2-input.rb +6 -0
  63. data/test/data/attic/unit_test_detect_rbtest2-output.rb +6 -0
  64. data/test/data/attic/unit_test_poetry-input.rb +50 -0
  65. data/test/data/attic/unit_test_poetry-output.rb +52 -0
  66. data/test/data/attic/unit_test_rbtest-input.rb +6 -0
  67. data/test/data/attic/unit_test_rbtest-output.rb +6 -0
  68. data/test/data/rct-complete-TDC/completion_in_method__testmethod.taf +17 -0
  69. data/test/data/rct-complete-TDC/completion_in_method__testscript.taf +17 -0
  70. data/test/data/rct-complete-TDC/completion_in_method__wrong_testmethod.taf +17 -0
  71. data/test/data/rct-complete/completion.taf +9 -0
  72. data/test/data/rct-complete/completion_class_info.taf +9 -0
  73. data/test/data/rct-complete/completion_class_info_no_candidates.taf +8 -0
  74. data/test/data/rct-complete/completion_detect_rbtest.taf +15 -0
  75. data/test/data/rct-complete/completion_detect_rbtest2.taf +9 -0
  76. data/test/data/rct-complete/completion_emacs.taf +13 -0
  77. data/test/data/rct-complete/completion_emacs_icicles.taf +13 -0
  78. data/test/data/rct-complete/completion_rbtest.taf +15 -0
  79. data/test/data/rct-doc/doc.taf +8 -0
  80. data/test/data/rct-doc/doc_detect_rbtest.taf +8 -0
  81. data/test/data/rct-doc/doc_detect_rbtest2.taf +14 -0
  82. data/test/data/rct-doc/doc_rbtest.taf +14 -0
  83. data/test/data/rct-doc/refe.taf +8 -0
  84. data/test/data/rct-doc/ri.taf +8 -0
  85. data/test/data/rct-doc/ri_emacs.taf +8 -0
  86. data/test/data/rct-doc/ri_vim.taf +8 -0
  87. data/test/data/xmpfilter/add_markers.taf +10 -0
  88. data/test/data/xmpfilter/bindings.taf +63 -0
  89. data/test/data/xmpfilter/comment_out.taf +22 -0
  90. data/test/data/xmpfilter/exception.taf +14 -0
  91. data/test/data/xmpfilter/expectations.taf +54 -0
  92. data/test/data/xmpfilter/last_match.taf +18 -0
  93. data/test/data/xmpfilter/mult.rb +9 -0
  94. data/test/data/xmpfilter/multi_line_annotation_1.taf +22 -0
  95. data/test/data/xmpfilter/multi_line_annotation_2.taf +24 -0
  96. data/test/data/xmpfilter/multi_line_annotation_3.taf +20 -0
  97. data/test/data/xmpfilter/multi_line_annotation_4.taf +22 -0
  98. data/test/data/xmpfilter/multi_line_annotation_5.taf +34 -0
  99. data/test/data/xmpfilter/no_warnings.taf +13 -0
  100. data/test/data/xmpfilter/nospace.taf +16 -0
  101. data/test/data/xmpfilter/rspec.taf +106 -0
  102. data/test/data/xmpfilter/rspec_poetry.taf +106 -0
  103. data/test/data/xmpfilter/simple_annotation.taf +22 -0
  104. data/test/data/xmpfilter/unit_test.taf +108 -0
  105. data/test/data/xmpfilter/unit_test_detect_rbtest.taf +108 -0
  106. data/test/data/xmpfilter/unit_test_detect_rbtest2.taf +18 -0
  107. data/test/data/xmpfilter/unit_test_poetry.taf +108 -0
  108. data/test/data/xmpfilter/unit_test_rbtest.taf +18 -0
  109. data/test/data/xmpfilter/width.taf +16 -0
  110. data/test/tmp_functional.rb +162 -0
  111. data/test/tmp_run.rb +66 -0
  112. metadata +127 -22
@@ -0,0 +1,48 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1
11
+ end
12
+
13
+
14
+ describe "xmpfilter's expectation expansion" do
15
+ before do
16
+ @o = X.new
17
+ end
18
+
19
+ it "should expand should == expectations" do
20
+ @o.foo(true) # =>
21
+ @o.foo(true).a # =>
22
+ @o.foo(false) # =>
23
+ end
24
+
25
+ it "should expand should raise_error expectations" do
26
+ @o.bar # =>
27
+ end
28
+
29
+ it "should expand should be_nil expectations" do
30
+ @o.baz # =>
31
+ end
32
+
33
+ it "should expand correct expectations for complex values" do
34
+ @o.babar # =>
35
+ end
36
+
37
+ it "should expand should be_close expectations" do
38
+ @o.fubar(10) # =>
39
+ end
40
+ end
41
+
42
+ describe "xmpfilter's automagic binding detection" do
43
+ it "should expand should == expectations" do
44
+ a = b = c = 1
45
+ d = a
46
+ d # =>
47
+ end
48
+ end
@@ -0,0 +1,52 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1 # !> already initialized constant A
11
+ end
12
+
13
+
14
+ describe "xmpfilter's expectation expansion" do
15
+ before do
16
+ @o = X.new
17
+ end
18
+
19
+ it "should expand should == expectations" do
20
+ @o.foo(true).should be_a_kind_of(X::Y)
21
+ @o.foo(true).inspect.should == "#<struct X::Y a=2>"
22
+ @o.foo(true).a.should == 2
23
+ @o.foo(false).should == 2
24
+ end
25
+
26
+ it "should expand should raise_error expectations" do
27
+ lambda{@o.bar}.should raise_error(RuntimeError)
28
+ end
29
+
30
+ it "should expand should be_nil expectations" do
31
+ @o.baz.should be_nil
32
+ end
33
+
34
+ it "should expand correct expectations for complex values" do
35
+ @o.babar.should == [1, 2]
36
+ end
37
+
38
+ it "should expand should be_close expectations" do
39
+ @o.fubar(10).should be_close(101.0, 0.0001)
40
+ end
41
+ end
42
+
43
+ describe "xmpfilter's automagic binding detection" do
44
+ it "should expand should == expectations" do
45
+ a = b = c = 1
46
+ d = a
47
+ d.should == a
48
+ d.should == b
49
+ d.should == c
50
+ d.should == 1
51
+ end
52
+ end
@@ -0,0 +1,8 @@
1
+
2
+ a = 1
3
+ 10.times do |i|
4
+ i ** 2 # =>
5
+ a += i
6
+ end
7
+ A = 1
8
+ A = 1
@@ -0,0 +1,8 @@
1
+
2
+ a = 1
3
+ 10.times do |i|
4
+ i ** 2 # => 0, 1, 4, 9, 16, 25, 36, 49, 64, 81
5
+ a += i
6
+ end
7
+ A = 1
8
+ A = 1 # !> already initialized constant A
@@ -0,0 +1,50 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1
11
+ def difftype() [1, "s"] end
12
+ end
13
+
14
+
15
+ require 'test/unit'
16
+ class Test_X < Test::Unit::TestCase
17
+ def setup
18
+ @o = X.new
19
+ end
20
+
21
+ def test_foo
22
+ @o.foo(true) # =>
23
+ @o.foo(true).a # =>
24
+ @o.foo(false) # =>
25
+ end
26
+
27
+ def test_bar
28
+ @o.bar # =>
29
+ end
30
+
31
+ def test_baz
32
+ @o.baz # =>
33
+ end
34
+
35
+ def test_babar
36
+ @o.babar # =>
37
+ end
38
+
39
+ def test_fubar
40
+ @o.fubar(10) # =>
41
+ end
42
+
43
+ def test_difftype
44
+ for x in @o.difftype
45
+ x # =>
46
+ end
47
+ end
48
+
49
+ end
50
+
@@ -0,0 +1,52 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1 # !> already initialized constant A
11
+ def difftype() [1, "s"] end
12
+ end
13
+
14
+
15
+ require 'test/unit'
16
+ class Test_X < Test::Unit::TestCase
17
+ def setup
18
+ @o = X.new
19
+ end
20
+
21
+ def test_foo
22
+ assert_kind_of(X::Y, @o.foo(true))
23
+ assert_equal("#<struct X::Y a=2>", @o.foo(true).inspect)
24
+ assert_equal(2, @o.foo(true).a)
25
+ assert_equal(2, @o.foo(false))
26
+ end
27
+
28
+ def test_bar
29
+ assert_raise(RuntimeError){@o.bar}
30
+ end
31
+
32
+ def test_baz
33
+ assert_nil(@o.baz)
34
+ end
35
+
36
+ def test_babar
37
+ assert_equal([1, 2], @o.babar)
38
+ end
39
+
40
+ def test_fubar
41
+ assert_in_delta(101.0, @o.fubar(10), 0.0001)
42
+ end
43
+
44
+ def test_difftype
45
+ for x in @o.difftype
46
+ #xmpfilter: WARNING!! extra values ignored
47
+ assert_equal(1, x)
48
+ end
49
+ end
50
+
51
+ end
52
+
@@ -0,0 +1,50 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1
11
+ def difftype() [1, "s"] end
12
+ end
13
+
14
+
15
+ require 'test/unit'
16
+ class Test_X < Test::Unit::TestCase
17
+ def setup
18
+ @o = X.new
19
+ end
20
+
21
+ def test_foo
22
+ @o.foo(true) # =>
23
+ @o.foo(true).a # =>
24
+ @o.foo(false) # =>
25
+ end
26
+
27
+ def test_bar
28
+ @o.bar # =>
29
+ end
30
+
31
+ def test_baz
32
+ @o.baz # =>
33
+ end
34
+
35
+ def test_babar
36
+ @o.babar # =>
37
+ end
38
+
39
+ def test_fubar
40
+ @o.fubar(10) # =>
41
+ end
42
+
43
+ def test_difftype
44
+ for x in @o.difftype
45
+ x # =>
46
+ end
47
+ end
48
+
49
+ end
50
+
@@ -0,0 +1,52 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1 # !> already initialized constant A
11
+ def difftype() [1, "s"] end
12
+ end
13
+
14
+
15
+ require 'test/unit'
16
+ class Test_X < Test::Unit::TestCase
17
+ def setup
18
+ @o = X.new
19
+ end
20
+
21
+ def test_foo
22
+ assert_kind_of(X::Y, @o.foo(true))
23
+ assert_equal("#<struct X::Y a=2>", @o.foo(true).inspect)
24
+ assert_equal(2, @o.foo(true).a)
25
+ assert_equal(2, @o.foo(false))
26
+ end
27
+
28
+ def test_bar
29
+ assert_raise(RuntimeError){@o.bar}
30
+ end
31
+
32
+ def test_baz
33
+ assert_nil(@o.baz)
34
+ end
35
+
36
+ def test_babar
37
+ assert_equal([1, 2], @o.babar)
38
+ end
39
+
40
+ def test_fubar
41
+ assert_in_delta(101.0, @o.fubar(10), 0.0001)
42
+ end
43
+
44
+ def test_difftype
45
+ for x in @o.difftype
46
+ #xmpfilter: WARNING!! extra values ignored
47
+ assert_equal(1, x)
48
+ end
49
+ end
50
+
51
+ end
52
+
@@ -0,0 +1,6 @@
1
+ =begin test_bar
2
+ bar("bar") # =>
3
+ =end
4
+ def bar(s)
5
+ s.upcase
6
+ end
@@ -0,0 +1,6 @@
1
+ =begin test_bar
2
+ assert_equal("BAR", bar("bar"))
3
+ =end
4
+ def bar(s)
5
+ s.upcase
6
+ end
@@ -0,0 +1,50 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1
11
+ def difftype() [1, "s"] end
12
+ end
13
+
14
+
15
+ require 'test/unit'
16
+ class Test_X < Test::Unit::TestCase
17
+ def setup
18
+ @o = X.new
19
+ end
20
+
21
+ def test_foo
22
+ @o.foo(true) # =>
23
+ @o.foo(true).a # =>
24
+ @o.foo(false) # =>
25
+ end
26
+
27
+ def test_bar
28
+ @o.bar # =>
29
+ end
30
+
31
+ def test_baz
32
+ @o.baz # =>
33
+ end
34
+
35
+ def test_babar
36
+ @o.babar # =>
37
+ end
38
+
39
+ def test_fubar
40
+ @o.fubar(10) # =>
41
+ end
42
+
43
+ def test_difftype
44
+ for x in @o.difftype
45
+ x # =>
46
+ end
47
+ end
48
+
49
+ end
50
+
@@ -0,0 +1,52 @@
1
+
2
+ class X
3
+ Y = Struct.new(:a)
4
+ def foo(b); b ? Y.new(2) : 2 end
5
+ def bar; raise "No good" end
6
+ def baz; nil end
7
+ def fubar(x); x ** 2.0 + 1 end
8
+ def babar; [1,2] end
9
+ A = 1
10
+ A = 1 # !> already initialized constant A
11
+ def difftype() [1, "s"] end
12
+ end
13
+
14
+
15
+ require 'test/unit'
16
+ class Test_X < Test::Unit::TestCase
17
+ def setup
18
+ @o = X.new
19
+ end
20
+
21
+ def test_foo
22
+ assert_kind_of X::Y, @o.foo(true)
23
+ assert_equal "#<struct X::Y a=2>", @o.foo(true).inspect
24
+ assert_equal 2, @o.foo(true).a
25
+ assert_equal 2, @o.foo(false)
26
+ end
27
+
28
+ def test_bar
29
+ assert_raise(RuntimeError){@o.bar}
30
+ end
31
+
32
+ def test_baz
33
+ assert_nil @o.baz
34
+ end
35
+
36
+ def test_babar
37
+ assert_equal [1, 2], @o.babar
38
+ end
39
+
40
+ def test_fubar
41
+ assert_in_delta 101.0, @o.fubar(10), 0.0001
42
+ end
43
+
44
+ def test_difftype
45
+ for x in @o.difftype
46
+ #xmpfilter: WARNING!! extra values ignored
47
+ assert_equal 1, x
48
+ end
49
+ end
50
+
51
+ end
52
+