<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" version="2.0">
<channel>
	<title>Comments for Dmytro Shteflyuk's Home</title>
	
	<link>http://kpumuk.info</link>
	<description>In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming.</description>
	<lastBuildDate>Tue, 29 Dec 2009 10:34:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/kpumuk-comments" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="kpumuk-comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on CodeColorer by Dmytro Shteflyuk</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285719</link>
		<dc:creator>Dmytro Shteflyuk</dc:creator>
		<pubDate>Sun, 21 Feb 2010 12:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285719</guid>
		<description>I don't like Geshi line numbers because when you copy code, browser copies them too. It's really weird thing, so I ended up with this table implementation. Your point about 100% makes sense, I'll take a look how it will impact code blocks layout.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t like Geshi line numbers because when you copy code, browser copies them too. It&#8217;s really weird thing, so I ended up with this table implementation. Your point about 100% makes sense, I&#8217;ll take a look how it will impact code blocks layout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by Douglas</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285716</link>
		<dc:creator>Douglas</dc:creator>
		<pubDate>Sun, 21 Feb 2010 05:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285716</guid>
		<description>Hi. There is a problem in your code that appear when yout set an image as background. To verify that creates a "stripe" image (www.stripegenerator.com) and add it as background (in codecolorer.css ) and you will see a continuity break (set the width as 100% in the plugin options). I searched in the code and I saw that the cause is the way that you show the line numbers. You calculate the numbers manually and create a table to show them. So there is a conflict between the end of the table and the rest of the container that you create to apply the user options. I solved in two ways. The simplest is to put a width="100%" in your second , so the table will fill all the container space.
The second is to use the Geshi methods to show the lines:

[cc_php]
$geshi-&gt;start_line_numbers_at($options['first_line']);
$geshi-&gt;enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
[/cc_php]

deleting the creation of the table.

thanks.</description>
		<content:encoded><![CDATA[<p>Hi. There is a problem in your code that appear when yout set an image as background. To verify that creates a &#8220;stripe&#8221; image (www.stripegenerator.com) and add it as background (in codecolorer.css ) and you will see a continuity break (set the width as 100% in the plugin options). I searched in the code and I saw that the cause is the way that you show the line numbers. You calculate the numbers manually and create a table to show them. So there is a conflict between the end of the table and the rest of the container that you create to apply the user options. I solved in two ways. The simplest is to put a width=&#8221;100%&#8221; in your second , so the table will fill all the container space.<br />
The second is to use the Geshi methods to show the lines:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">start_line_numbers_at</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'first_line'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enable_line_numbers</span><span style="color: #009900;">&#40;</span>GESHI_FANCY_LINE_NUMBERS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>deleting the creation of the table.</p>
<p>thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by Deimos</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285720</link>
		<dc:creator>Deimos</dc:creator>
		<pubDate>Sun, 21 Feb 2010 15:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285720</guid>
		<description>странно у вас не появилась ошибка, у меня пишет:
[cc]GeSHi Error: GeSHi could not find the language (using path /wp-content/plugins/codecolorer/lib/geshi/) (code 2)[/cc]</description>
		<content:encoded><![CDATA[<p>странно у вас не появилась ошибка, у меня пишет:</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">GeSHi Error: GeSHi could not find the language (using path /wp-content/plugins/codecolorer/lib/geshi/) (code 2)</div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by Deimos</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285651</link>
		<dc:creator>Deimos</dc:creator>
		<pubDate>Sun, 21 Feb 2010 15:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285651</guid>
		<description>Добрый день, подскажите как то можно сделать чтобы когда человек вводит
{code lang=""}тут текст{code} (специально заменил)
не вылазила ошибка, вот такая:
[cc_html]&lt;code&gt;тут текст&lt;code&gt;[/cc_html]
У меня стоит последняя 0.9.7 версия, версия WordPress 2.7.1
</description>
		<content:encoded><![CDATA[<p>Добрый день, подскажите как то можно сделать чтобы когда человек вводит<br />
{code lang=&#8221;"}тут текст{code} (специально заменил)<br />
не вылазила ошибка, вот такая:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;</span>тут текст<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;</span></div></td></tr></tbody></table></div>
<p>У меня стоит последняя 0.9.7 версия, версия WordPress 2.7.1</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by Tsalagi</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285721</link>
		<dc:creator>Tsalagi</dc:creator>
		<pubDate>Sun, 21 Feb 2010 05:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285721</guid>
		<description>Try again.
1. When I use [cci_bash]no_cc="true"[/cci_bash] my text is removed from my page.</description>
		<content:encoded><![CDATA[<p>Try again.<br />
1. When I use <code class="codecolorer bash default"><span class="bash"><span style="color: #007800;">no_cc</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span></code> my text is removed from my page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by Tsalagi</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285642</link>
		<dc:creator>Tsalagi</dc:creator>
		<pubDate>Sun, 21 Feb 2010 05:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285642</guid>
		<description>Is this plugin supported on this website. If so I need some solutions to two issues.
1. When I use [cci_html]&lt;code&gt;[/cci_html] it removes my text from my page. 
2. When I set a theme I still get no colors on the code on my page.

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Is this plugin supported on this website. If so I need some solutions to two issues.<br />
1. When I use <code class="codecolorer html4strict default"><span class="html4strict"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">code</span>&gt;</span></span></code> it removes my text from my page.<br />
2. When I set a theme I still get no colors on the code on my page.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by IgorKa - Информационный ресурс » Wordpress - подсветка кода</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285573</link>
		<dc:creator>IgorKa - Информационный ресурс » Wordpress - подсветка кода</dc:creator>
		<pubDate>Sun, 21 Feb 2010 18:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285573</guid>
		<description>[...] на codecolorer. Прочесть об этом плагине рекомендую на странице автора. В общем пока остановился на этом плагине, так [...]</description>
		<content:encoded><![CDATA[<p>[...] на codecolorer. Прочесть об этом плагине рекомендую на странице автора. В общем пока остановился на этом плагине, так [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on CodeColorer by Dmytro Shteflyuk</title>
		<link>http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285530</link>
		<dc:creator>Dmytro Shteflyuk</dc:creator>
		<pubDate>Sun, 21 Feb 2010 17:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/projects/wordpress-plugins/codecolorer/#comment-285530</guid>
		<description>You can do it using [cci]first_line[/cci] option:

[cc_php first_line="3"]
$butnotme = 2;
[/cc_php]</description>
		<content:encoded><![CDATA[<p>You can do it using <code class="codecolorer text default"><span class="text">first_line</span></code> option:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>3<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$butnotme</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on My top 7 RSpec best practices by Dmytro Shteflyuk</title>
		<link>http://kpumuk.info/ruby-on-rails/my-top-7-rspec-best-practices/#comment-285492</link>
		<dc:creator>Dmytro Shteflyuk</dc:creator>
		<pubDate>Sun, 21 Feb 2010 00:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/?p=1080#comment-285492</guid>
		<description>Hey Myron, thank you for the reply. I have updated an article with more consistent [cci_ruby]context[/cci_ruby] usage, it was my failure.

About mocking in controllers, yes it makes sense. Sometimes. When you pretty sure you models work as expected, when you confident in their work. As I said, in some circumstances you can get false positives, for example, when add [cci_ruby]after_create[/cci_ruby] hook which fails with an exception, or new super-useful [cci_sql]NOT NULL[/cci_sql] restriction on one of columns in the database. If you have all your models covered with — it's ok, use mocks to get controller specs clean in simple. By the way, did you hear about &lt;a href="http://rspec.rubyforge.org/rspec-rails/1.2.9/classes/Spec/Rails/Mocks.html#M000014" rel="nofollow"&gt;stub_model&lt;/a&gt;?</description>
		<content:encoded><![CDATA[<p>Hey Myron, thank you for the reply. I have updated an article with more consistent <code class="codecolorer ruby default"><span class="ruby">context</span></code> usage, it was my failure.</p>
<p>About mocking in controllers, yes it makes sense. Sometimes. When you pretty sure you models work as expected, when you confident in their work. As I said, in some circumstances you can get false positives, for example, when add <code class="codecolorer ruby default"><span class="ruby">after_create</span></code> hook which fails with an exception, or new super-useful <code class="codecolorer sql default"><span class="sql"><span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span></span></code> restriction on one of columns in the database. If you have all your models covered with — it&#8217;s ok, use mocks to get controller specs clean in simple. By the way, did you hear about <a href="http://rspec.rubyforge.org/rspec-rails/1.2.9/classes/Spec/Rails/Mocks.html#M000014" rel="nofollow">stub_model</a>?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on My top 7 RSpec best practices by Myron</title>
		<link>http://kpumuk.info/ruby-on-rails/my-top-7-rspec-best-practices/#comment-285487</link>
		<dc:creator>Myron</dc:creator>
		<pubDate>Sun, 21 Feb 2010 19:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/?p=1080#comment-285487</guid>
		<description>These are some good tips, but I don't fully agree with all them.  Particular points 4 and 5:

About mocks: In general, I agree with you that over mocking is a problem.  But I disagree that it's always better to use no mocking or stubbing in your controller specs.  In my opinion, the danger of mocking is directly proportional to how likely it is the interface you are mocking will change.  So, mocking a class method that frequently changes its interface is dangerous and should be avoided.  Mocking an interface that is highly unlikely to change is generally safe and can lead to less brittle tests.

So, for example, when I'm spec'ing the #update and #create actions of a controller, I mock #valid? so that it returns true or false based on which code path I want to test.  The alternative is to pass valid or invalid attributes in the request, but this leads to fragile specs: now my controller specs have to know what attribute values are valid and invalid, and when my model validation logic changes, my controller specs begin to fail.  Really, I don't care in my controller specs what is valid and invalid...I just care that when the attributes are valid, it does one thing, and when they are invalid, it does another thing.  #valid? has been around in ActiveRecord for as long as I can remember (I imagine it was there from the first release) and the likely hood of that interface ever changing is approximately nil.  I think it's safe and useful to use mocking here.

About describe vs. context: In your example, you use context for both ".top" and "when just created".  I think context is appropriate for the latter (since "when just created" describes a context the examples run in) but describe is more appropriate for the former.  ".top" isn't a context; rather it's simply grouping all the examples where you are describing the top method.  I use use describe in these cases since you're describing the behavior of a method.</description>
		<content:encoded><![CDATA[<p>These are some good tips, but I don&#8217;t fully agree with all them.  Particular points 4 and 5:</p>
<p>About mocks: In general, I agree with you that over mocking is a problem.  But I disagree that it&#8217;s always better to use no mocking or stubbing in your controller specs.  In my opinion, the danger of mocking is directly proportional to how likely it is the interface you are mocking will change.  So, mocking a class method that frequently changes its interface is dangerous and should be avoided.  Mocking an interface that is highly unlikely to change is generally safe and can lead to less brittle tests.</p>
<p>So, for example, when I&#8217;m spec&#8217;ing the #update and #create actions of a controller, I mock #valid? so that it returns true or false based on which code path I want to test.  The alternative is to pass valid or invalid attributes in the request, but this leads to fragile specs: now my controller specs have to know what attribute values are valid and invalid, and when my model validation logic changes, my controller specs begin to fail.  Really, I don&#8217;t care in my controller specs what is valid and invalid&#8230;I just care that when the attributes are valid, it does one thing, and when they are invalid, it does another thing.  #valid? has been around in ActiveRecord for as long as I can remember (I imagine it was there from the first release) and the likely hood of that interface ever changing is approximately nil.  I think it&#8217;s safe and useful to use mocking here.</p>
<p>About describe vs. context: In your example, you use context for both &#8220;.top&#8221; and &#8220;when just created&#8221;.  I think context is appropriate for the latter (since &#8220;when just created&#8221; describes a context the examples run in) but describe is more appropriate for the former.  &#8220;.top&#8221; isn&#8217;t a context; rather it&#8217;s simply grouping all the examples where you are describing the top method.  I use use describe in these cases since you&#8217;re describing the behavior of a method.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
