Sha256: cff8b9bf72807a676e41cef0a8fd37a6481cee84dcdc62a5652987ac7042be3d
Contents?: true
Size: 677 Bytes
Versions: 12
Compression:
Stored size: 677 Bytes
Contents
require 'rubygems' require 'parse_tree' require 'spec/test_to_spec/sexp_transformer' require 'spec/test_to_spec/ruby2ruby' module Test module Unit class TestCase # Returns a String representing the RSpec translation of this class def self.to_rspec tree = ParseTree.new.parse_tree(self).first rspec_tree = Spec::TestToSpec::SexpTransformer.new.process(tree) modules = self.name.split("::")[0..-2] result = "" result += modules.collect{|m| "module #{m}\n"}.join("") result += RubyToRuby.new.process(rspec_tree[0]) result += modules.collect{|m| "\nend"}.join("") result end end end end
Version data entries
12 entries across 12 versions & 1 rubygems