Sha256: e37fc05cfd14bad454177927fe551eeb0926940638c281a5c368ec56a089e3e6
Contents?: true
Size: 881 Bytes
Versions: 6
Compression:
Stored size: 881 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' require 'mspec/expectations/expectations' require 'mspec/matchers/stringsymboladapter' describe StringSymbolAdapter, "#convert_name" do include StringSymbolAdapter before :all do @verbose = $VERBOSE $VERBOSE = nil end after :all do $VERBOSE = @verbose end before :each do @ruby_version = Object.const_get :RUBY_VERSION end after :each do Object.const_set :RUBY_VERSION, @ruby_version end it "converts the name to a string if RUBY_VERSION < 1.9" do Object.const_set :RUBY_VERSION, "1.8.6" convert_name("name").should == "name" convert_name(:name).should == "name" end it "converts the name to a symbol if RUBY_VERSION >= 1.9" do Object.const_set :RUBY_VERSION, "1.9.0" convert_name("name").should == :name convert_name(:name).should == :name end end
Version data entries
6 entries across 6 versions & 1 rubygems