From 9192a26828e0dd4fd0a7058f70cbd8a031e22f1f Mon Sep 17 00:00:00 2001 From: Michael Bleigh Date: Thu, 28 Jul 2011 23:32:57 -0500 Subject: Trying to fix up specs for multi-rubies. --- Gemfile.lock | 1 + spec/hashie/mash_spec.rb | 26 +++++++++----------------- spec/spec_helper.rb | 1 - 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1b2840a..08b0da9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,6 +23,7 @@ GEM thor (0.14.6) PLATFORMS + java ruby DEPENDENCIES diff --git a/spec/hashie/mash_spec.rb b/spec/hashie/mash_spec.rb index 4ea86b7..deec6e9 100644 --- a/spec/hashie/mash_spec.rb +++ b/spec/hashie/mash_spec.rb @@ -226,14 +226,16 @@ describe Hashie::Mash do Hashie::Mash.new(:abc => 'def').should be_respond_to(:abc) end - it "should delegate properly using delegate library" do - class MashDelegate < DelegateClass(Hashie::Mash) + unless defined?(JRUBY_VERSION) + it "should delegate properly using delegate library" do + class MashDelegate < DelegateClass(Hashie::Mash) + end + + delegate = MashDelegate.new(Hashie::Mash.new(:foo => 100)) + delegate.foo.should == 100 + delegate.should respond_to(:foo) + expect { delegate.bar }.to raise_error(NoMethodError) end - - delegate = MashDelegate.new(Hashie::Mash.new(:foo => 100)) - delegate.foo.should == 100 - delegate.should respond_to(:foo) - expect { delegate.bar }.to raise_error(NoMethodError) end end @@ -275,15 +277,5 @@ describe Hashie::Mash do initial.test.should == [] initial.test?.should be_true end - - describe "to_json" do - - it "should render to_json" do - @mash.foo = :bar - @mash.bar = {"homer" => "simpson"} - expected = {"foo" => "bar", "bar" => {"homer" => "simpson"}} - JSON.parse(@mash.to_json).should == expected - end - end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f337159..c8043e9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,4 @@ require 'rubygems' -require 'json' $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -- cgit v1.2.1