@@ -6,52 +6,68 @@ describe "Series" do
6
6
it " can find the largest product of 2 with numbers in order" do
7
7
Series .new(" 0123456789" ).largest_product(2 ).should eq 72
8
8
end
9
- it " can find the largest product of 2" do
9
+
10
+ pending " can find the largest product of 2" do
10
11
Series .new(" 576802143" ).largest_product(2 ).should eq 48
11
12
end
12
- it " finds the largest product if span equals length" do
13
+
14
+ pending " finds the largest product if span equals length" do
13
15
Series .new(" 29" ).largest_product(2 ).should eq 18
14
16
end
15
- it " can find the largest product of 3 with numbers in order" do
17
+
18
+ pending " can find the largest product of 3 with numbers in order" do
16
19
Series .new(" 0123456789" ).largest_product(3 ).should eq 504
17
20
end
18
- it " can find the largest product of 3" do
21
+
22
+ pending " can find the largest product of 3" do
19
23
Series .new(" 1027839564" ).largest_product(3 ).should eq 270
20
24
end
21
- it " can find the largest product of 5 with numbers in order" do
25
+
26
+ pending " can find the largest product of 5 with numbers in order" do
22
27
Series .new(" 0123456789" ).largest_product(5 ).should eq 15120
23
28
end
24
- it " can get the largest product of a big number" do
29
+
30
+ pending " can get the largest product of a big number" do
25
31
Series .new(" 73167176531330624919225119674426574742355349194934" ).largest_product(6 ).should eq 23520
26
32
end
27
- it " can get the largest product of a big number II" do
33
+
34
+ pending " can get the largest product of a big number II" do
28
35
Series .new(" 52677741234314237566414902593461595376319419139427" ).largest_product(6 ).should eq 28350
29
36
end
30
- it " can get the largest product of a big number (Project Euler)" do
37
+
38
+ pending " can get the largest product of a big number (Project Euler)" do
31
39
Series.new("7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450").largest_product(13).should eq 23514624000
32
40
end
33
- it " reports zero if the only digits are zero" do
41
+
42
+ pending " reports zero if the only digits are zero" do
34
43
Series .new(" 0000" ).largest_product(2 ).should eq 0
35
44
end
36
- it " reports zero if all spans include zero" do
45
+
46
+ pending " reports zero if all spans include zero" do
37
47
Series .new(" 99099" ).largest_product(3 ).should eq 0
38
48
end
39
- it " rejects span longer than string length" do
49
+
50
+ pending " rejects span longer than string length" do
40
51
expect_raises(ArgumentError ) { Series .new(" 123" ).largest_product(4 ) }
41
52
end
42
- it " reports 1 for empty string and empty product (0 span)" do
53
+
54
+ pending " reports 1 for empty string and empty product (0 span)" do
43
55
Series .new(" " ).largest_product(0 ).should eq 1
44
56
end
45
- it " reports 1 for nonempty string and empty product (0 span)" do
57
+
58
+ pending " reports 1 for nonempty string and empty product (0 span)" do
46
59
Series .new(" 123" ).largest_product(0 ).should eq 1
47
60
end
48
- it " rejects empty string and nonzero span" do
61
+
62
+ pending " rejects empty string and nonzero span" do
49
63
expect_raises(ArgumentError ) { Series .new(" " ).largest_product(1 ) }
50
64
end
51
- it " rejects invalid character in digits" do
65
+
66
+ pending " rejects invalid character in digits" do
52
67
expect_raises(ArgumentError ) { Series .new(" 1234a5" ).largest_product(2 ).should eq -1 }
53
68
end
54
- it " rejects negative span" do
69
+
70
+ pending " rejects negative span" do
55
71
expect_raises(ArgumentError ) { Series .new(" 12345" ).largest_product(-1 ) }
56
72
end
57
73
end
0 commit comments