diff options
author | Michael Bleigh <michael@intridea.com> | 2011-07-28 23:32:57 -0500 |
---|---|---|
committer | Michael Bleigh <michael@intridea.com> | 2011-07-28 23:32:57 -0500 |
commit | 9192a26828e0dd4fd0a7058f70cbd8a031e22f1f (patch) | |
tree | 9839d6a82dbaa3db473e4f97522c320eb8035807 | |
parent | 82046d15d34d17faac57e5a6553f35a997acae79 (diff) | |
download | hashie-9192a26828e0dd4fd0a7058f70cbd8a031e22f1f.tar.gz |
Trying to fix up specs for multi-rubies.
-rw-r--r-- | Gemfile.lock | 1 | ||||
-rw-r--r-- | spec/hashie/mash_spec.rb | 26 | ||||
-rw-r--r-- | 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')) |