Sha256: c8a04cd14b7c1411a82a959c6ce5f9170718628b4bd57c20c1cb6d0dae45f7b7

Contents?: true

Size: 435 Bytes

Versions: 2

Compression:

Stored size: 435 Bytes

Contents

require 'spec_helper'
describe "to_ruby_literal" do

  VALUES.each do |value|
    describe "on #{value.inspect}" do
      specify{ Kernel.eval(value.to_ruby_literal).should eq(value) }  
    end
  end
  
  it "should work on objects that implement to_ruby_literal" do
    class ToRubyLiteralizable
      def to_ruby_literal
        :foo
      end
    end
    Myrrha.to_ruby_literal(ToRubyLiteralizable.new).should eq(:foo)
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
myrrha-1.1.0 spec/test_to_ruby_literal.rb
myrrha-1.0.0 spec/test_to_ruby_literal.rb