Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Missing in commit

  • Loading branch information...
commit efb0b764de65f4a3e98eaa444b5e7c0768d65ad8 1 parent 9bfff35
Gerry Gleason authored
View
2  lib/chunk_manager.rb
@@ -57,7 +57,7 @@ def scan_chunkid(text)
text.scan(MASK_RE[ACTIVE_CHUNKS]){|a| yield a[0] }
end
- def find_chunks(chunk_type)
+ def find_chunks chunk_type=Chunk::Abstract
@chunks.select { |chunk| chunk.kind_of?(chunk_type) and chunk.rendered? }
end
View
8 spec/helpers/chunk_spec_helper.rb
@@ -46,15 +46,13 @@ def assert_no_difference object, method, &block
# Asserts that test_text doesn't match the chunk_type
def no_match chunk_type, test_text
- if chunk_type.respond_to? :pattern
- assert_no_match chunk_type.pattern, test_text
- end
+ chunk_type.pattern.should_not match test_text
end
def assert_conversion_does_not_apply chunk_type, str
processed_str = ContentStub.new str.dup
- chunk_type.apply_to processed_str
- assert_equal str, processed_str
+ chunk_type.apply_to( processed_str )
+ processed_str.find_chunks.count.should == 0
end
private
View
13 spec/lib/chunks/uri_spec.rb
@@ -94,13 +94,13 @@
:scheme =>'http', :host =>'www.example.com.tw', :port => '80', :path => '/HelpOnNavigation',
:query => 'arg=val&arg2=val2',
:link_text => 'http://www.example.com.tw:80/HelpOnNavigation?arg=val&arg2=val2')
- # with an anchor
- match_chunk(URIChunk, 'irc://irc.freenode.net#recentchangescamp',
+ # with an anchor
+ match_chunk(URIChunk, 'irc://irc.freenode.net#recentchangescamp',
:scheme =>'irc', :host =>'irc.freenode.net',
:fragment => '#recentchangescamp',
:link_text => 'irc://irc.freenode.net#recentchangescamp')
- # HTTPS
+ # HTTPS
match_chunk(URIChunk, 'https://www.example.com',
:scheme =>'https', :host =>'www.example.com', :port => nil, :path => nil, :query => nil,
:link_text => 'https://www.example.com')
@@ -131,12 +131,13 @@
match_chunk(URIChunk, 'http://support.microsoft.com/default.aspx?scid=kb;en-us;234562',
:scheme =>'http', :host => 'support.microsoft.com', :path => '/default.aspx',
:query => 'scid=kb;en-us;234562')
+
end
it "should test_email_uri" do
- match_chunk(URIChunk, 'mail@example.com',
- :user => 'mail', :host => 'example.com', :link_text => 'mail@example.com'
- )
+ match_chunk(URIChunk, 'mail@example.com',
+ :user => 'mail', :host => 'example.com', :link_text => 'mail@example.com'
+ )
end
it "should test_non_email" do
Please sign in to comment.
Something went wrong with that request. Please try again.