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

Version Path
rspec-0.5.10 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.5.12 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.5.11 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.5.14 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.5.13 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.5.15 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.5.16 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.6.2 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.6.3 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.6.4 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.6.1 lib/spec/test_to_spec/test_case_ext.rb
rspec-0.6.0 lib/spec/test_to_spec/test_case_ext.rb