Skip to content
Browse files

Sidu: Fixing specs

  • Loading branch information...
1 parent b1c60b8 commit 249d34ff709878d21279bba8fa512c90779feec1 @kaiwren committed Jun 17, 2009
View
2 README.rdoc
@@ -1,4 +1,4 @@
-= Wrest
+= Wrest
(c) Copyright 2009 {Sidu Ponnappa}[http://blog.sidu.in]. All Rights Reserved.
View
21 Rakefile
@@ -7,11 +7,16 @@
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.
-require 'rubygems'
-gem 'rspec'
-require 'rake'
-require 'spec'
-require 'spec/rake/spectask'
+if Object.const_defined?('RAILS_ROOT')
+ require File.dirname(__FILE__) + '/../../../config/environment'
+else
+ require 'rubygems'
+ gem 'rspec'
+ require 'rake'
+ require 'spec'
+ require 'spec/rake/spectask'
+ require 'metric_fu'
+end
puts "Building on Ruby #{RUBY_VERSION}, #{RUBY_RELEASE_DATE}, #{RUBY_PLATFORM}"
@@ -29,7 +34,7 @@ begin
rescue LoadError
puts 'Hanna not available, using standard Rake rdoctask. Fix this by running gem install mislav-hanna.'
require 'rake/rdoctask'
-end
+end
desc 'Generate documentation for Wrest'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
@@ -74,10 +79,10 @@ begin
gemspec.add_dependency('activesupport', '>= 2.3.2')
case RUBY_PLATFORM
when /java/
- gemspec.add_dependency('json-jruby', '>= 1.1.3')
+ gemspec.add_dependency('json-jruby', '>= 1.1.3')
gemspec.platform = 'java'
else
- gemspec.add_dependency('json', '>= 1.1.3')
+ gemspec.add_dependency('json', '>= 1.1.3')
gemspec.platform = Gem::Platform::RUBY
end
end
View
3 spec/wrest/components/attributes_container_spec.rb
@@ -187,7 +187,8 @@ def method_missing(method_name, *args)
zotoh_zhaan.species = "Human"
lambda{@li_piao.species}.should raise_error(NoMethodError)
lambda{@li_piao.species?}.should raise_error(NoMethodError)
- lambda{@li_piao.species = "Human"}.should raise_error(NoMethodError)
+ @li_piao.should_not respond_to(:species=)
+ @li_piao.methods.grep(/:species=/).should be_empty
end
end
end
View
2 spec/wrest/resource/base_spec.rb
@@ -10,7 +10,7 @@ class BottledUniverse < Glassware
end
module Wrest
- describe Resource::Base do
+ describe Wrest::Resource::Base do
it "should not affect other classes when setting up its macros" do
Class.should_not respond_to(:host=)
Object.should_not respond_to(:host=)
View
2 spec/wrest/response_spec.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../spec_helper'
module Wrest
- describe Response do
+ describe Wrest::Response do
it "should know how to delegate to a translator" do
http_response = mock('response')
Components::Translators::Xml.should_receive(:deserialise).with(http_response)
View
2 spec/wrest/uri_spec.rb
@@ -1,7 +1,7 @@
require File.dirname(__FILE__) + '/../spec_helper'
module Wrest
- describe Uri do
+ describe Wrest::Uri do
def build_ok_response(body = '')
returning mock(Net::HTTPOK) do |response|
response.stub!(:code).and_return('200')
View
2 spec/wrest/uri_template_spec.rb
@@ -10,7 +10,7 @@
require File.dirname(__FILE__) + '/../spec_helper'
module Wrest
- describe UriTemplate do
+ describe Wrest::UriTemplate do
it "should not maintain a reference to the string it is initialized with" do
url_pattern = "http://localhost:3000/:resource/:id.:format"
template = UriTemplate.new(url_pattern)

0 comments on commit 249d34f

Please sign in to comment.
Something went wrong with that request. Please try again.