From 86d53c73a8a7f7ac22e35782c1dae5477e2ef987 Mon Sep 17 00:00:00 2001 From: erwanlr Date: Sat, 30 Mar 2013 19:40:54 +0100 Subject: [PATCH] WpTimthumb#== specs --- spec/lib/common/models/wp_timthumb_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/lib/common/models/wp_timthumb_spec.rb b/spec/lib/common/models/wp_timthumb_spec.rb index 534cb310..34aad56a 100644 --- a/spec/lib/common/models/wp_timthumb_spec.rb +++ b/spec/lib/common/models/wp_timthumb_spec.rb @@ -10,4 +10,22 @@ describe WpTimthumb do let(:uri) { URI.parse('http://example.com/') } let(:options) { { path: 'path-to/a/timtuhumb.php' } } + describe '#==' do + context 'when both url are equal' do + it 'returns true' do + WpTimthumb.new(uri, path: 'timtuhumb.php'). + should == + WpTimthumb.new(uri, path: 'timtuhumb.php') + end + end + + context 'when urls are different' do + it 'returns false' do + WpTimthumb.new(uri, path: 'hello/timtuhumb.php'). + should_not == + WpTimthumb.new(uri, path: 'some-dir/timtuhumb.php') + end + end + end + end