jquery-cheat 0.2.0 → 0.2.1
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/History.txt +12 -1
- data/lib/jquery-cheat/version.rb +1 -1
- data/test/test_jquery-cheat.rb +10 -10
- data/website/index.html +1 -1
- metadata +1 -1
data/History.txt
CHANGED
@@ -11,4 +11,15 @@
|
|
11
11
|
== 0.1.2 2007-06-01
|
12
12
|
|
13
13
|
* 1 minor bugfix
|
14
|
-
* removed dependency on Marshal
|
14
|
+
* removed dependency on Marshal
|
15
|
+
|
16
|
+
== 0.2.0 2007-06-01
|
17
|
+
|
18
|
+
* 2 major enhancements:
|
19
|
+
* complete refactor
|
20
|
+
* support for filters
|
21
|
+
|
22
|
+
== 0.2.1 2007-06-01
|
23
|
+
|
24
|
+
* 1 trivial enhancement
|
25
|
+
* fixed tests
|
data/lib/jquery-cheat/version.rb
CHANGED
data/test/test_jquery-cheat.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
2
|
require 'flexmock/test_unit'
|
3
3
|
|
4
|
-
StubMethod =
|
5
|
-
StubMethods =
|
4
|
+
StubMethod = JQuery::Method.dup
|
5
|
+
StubMethods = JQuery::Methods.dup
|
6
6
|
|
7
7
|
class StubMethod
|
8
8
|
def initialize options = {}
|
@@ -33,11 +33,11 @@ class TestJQueryCheat < Test::Unit::TestCase
|
|
33
33
|
|
34
34
|
def test_named
|
35
35
|
assert_hash_equals_filter({:name => '$'}, "method[@name='$']")
|
36
|
-
assert_hash_equals_filter({:name => '$', :
|
36
|
+
assert_hash_equals_filter({:name => '$', :substring => false}, "method[@name='$']")
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_named_imprecise
|
40
|
-
assert_hash_equals_filter({:name => '$', :
|
40
|
+
assert_hash_equals_filter({:name => '$', :substring => true}, "method[@name*='$']")
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_module
|
@@ -51,22 +51,22 @@ class TestJQueryCheat < Test::Unit::TestCase
|
|
51
51
|
|
52
52
|
def test_like
|
53
53
|
expected_parse = @@parsed.search("method[@cat*='Plugins']").reject {|m| m.search("> desc").inner_text !~ /clear/i }
|
54
|
-
assert_equal
|
54
|
+
assert_equal JQuery::Parser.get_methods_by_hash(:module => "Plugins", :recursive => true, :like => ["clear"]).inner_html, expected_parse.inner_html
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_like_multiple
|
58
58
|
expected_parse = @@parsed.search("method[@cat*='Plugins']").reject {|m| m.search("> desc").inner_text !~ /clear/i || m.search("> desc").inner_text !~ /field/i }
|
59
|
-
assert_equal
|
59
|
+
assert_equal JQuery::Parser.get_methods_by_hash(:module => "Plugins", :recursive => true, :like => ["clear", "field"]).inner_html, expected_parse.inner_html
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_params
|
63
63
|
expected_parse = @@parsed.search("method[@cat*='Core']").reject {|m| m.search("params[@name=html]").length == 0 }
|
64
|
-
assert_equal
|
64
|
+
assert_equal JQuery::Parser.get_methods_by_hash(:module => "Core", :recursive => true, :params => ["html"]).inner_html, expected_parse.inner_html
|
65
65
|
end
|
66
66
|
|
67
67
|
def test_params_multiple
|
68
68
|
expected_parse = @@parsed.search("method[@cat*='Core']").reject {|m| m.search("params[@name=expr]").length == 0 || m.search("params[@name=context]").length == 0}
|
69
|
-
assert_equal
|
69
|
+
assert_equal JQuery::Parser.get_methods_by_hash(:module => "Core", :recursive => true, :params => ["expr", "context"]).inner_html, expected_parse.inner_html
|
70
70
|
end
|
71
71
|
|
72
72
|
def test_signature
|
@@ -82,11 +82,11 @@ class TestJQueryCheat < Test::Unit::TestCase
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_new_methods_by_hash
|
85
|
-
assert_equal
|
85
|
+
assert_equal JQuery::Methods.new(:name => '$').length, JQuery::Parser.get_methods_by_hash(:name => '$').length
|
86
86
|
end
|
87
87
|
|
88
88
|
def assert_hash_equals_filter hash, filter
|
89
|
-
assert_equal
|
89
|
+
assert_equal JQuery::Parser.get_methods_by_hash(hash).inner_html, @@parsed.search(filter).inner_html
|
90
90
|
end
|
91
91
|
|
92
92
|
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>jquery cheat</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/jquery-cheat"; return false'>
|
35
35
|
Get Version
|
36
|
-
<a href="http://rubyforge.org/projects/jquery-cheat" class="numbers">0.2.
|
36
|
+
<a href="http://rubyforge.org/projects/jquery-cheat" class="numbers">0.2.1</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘jquery-cheat’</h1>
|
39
39
|
|