Created
          March 20, 2011 02:31 
        
      - 
      
- 
        Save ukstudio/878004 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # coding: utf-8 | |
| RSpec.configure do |c| | |
| c.filter_run_excluding :ruby => lambda{|version| | |
| !(RUBY_VERSION.to_s =~ /^#{version.to_s}/) | |
| } | |
| end | |
| describe Hash do | |
| context 'object_id' do | |
| before(:all) do | |
| @hash = {'object_id' => 7134} | |
| end | |
| subject { @hash } | |
| # どっかのobject_idが呼ばれとる | |
| its(['object_id']) { should_not eq 7134 } | |
| its(['object_id']) { should_not eq subject.object_id } | |
| its([:object_id]) { should_not be_nil } | |
| its([:object_id]) { should_not eq 7134 } | |
| its([:object_id]) { should_not eq subject.object_id } | |
| end | |
| context 'stringとsimbolで同名' do | |
| before(:all) do | |
| @hash = {'name' => 7134, :name => 1234} | |
| end | |
| subject { @hash } | |
| its(['name']) { pending('simbolの方が呼ばれる'); should eq @hash['name'] } | |
| its(['name']) { should eq @hash[:name] } | |
| its([:name]) { should eq 1234 } | |
| end | |
| end | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment