rubyuw 0.99.3 → 0.99.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/rubyuw/curriculum.rb +4 -0
- data/rubyuw.gemspec +1 -1
- data/test/mocked/curriculum_test.rb +9 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.99.
|
1
|
+
0.99.4
|
data/lib/rubyuw/curriculum.rb
CHANGED
@@ -42,6 +42,10 @@ module RubyUW
|
|
42
42
|
def find(curriculum, term)
|
43
43
|
curriculum = curriculum.strip # So we don't modify the original variable
|
44
44
|
type = !!(curriculum =~ /^(.+?)(\d+)$/) ? :course : :curriculum
|
45
|
+
|
46
|
+
# Strip '+' out of terms so that WIN+2010 works (which is expected for SLNs and such)
|
47
|
+
term = term.gsub('+', '')
|
48
|
+
|
45
49
|
send("find_#{type}", curriculum, term)
|
46
50
|
end
|
47
51
|
|
data/rubyuw.gemspec
CHANGED
@@ -17,7 +17,7 @@ class CurriculumTest < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
should "recognize each of the curriculums" do
|
20
|
-
RubyUW::Curriculum.expects(:find_curriculum).times(@curriculums.length)
|
20
|
+
RubyUW::Curriculum.expects(:find_curriculum).times(@curriculums.length).with(anything, @term)
|
21
21
|
RubyUW::Curriculum.expects(:find_course).never
|
22
22
|
|
23
23
|
@curriculums.each do |curriculum|
|
@@ -33,6 +33,14 @@ class CurriculumTest < Test::Unit::TestCase
|
|
33
33
|
RubyUW::Curriculum.find(course, @term)
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
should "strip '+' out of the term" do
|
38
|
+
@term = "WIN+2010"
|
39
|
+
@fixed_term = "WIN2010"
|
40
|
+
|
41
|
+
RubyUW::Curriculum.expects(:find_curriculum).once.with(anything, @fixed_term)
|
42
|
+
RubyUW::Curriculum.find(@curriculums[0], @term)
|
43
|
+
end
|
36
44
|
end
|
37
45
|
|
38
46
|
context "finding course information" do
|