Files

Class Index [+]

Quicksearch

Ubiquo::Extensions::TestCase::ClassMethods

Public Instance Methods

teardown() click to toggle source
teardown_with_fixture_set() click to toggle source

(Not documented)

     # File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/test_case.rb, line 102
102:         def teardown_with_fixture_set
103:           ActiveSupport::TestCase.fixture_path = @@original_fixture_path
104:         end
Also aliased as: teardown
test_each_connector(plugin) {|| ...} click to toggle source

Tests all the test methods inside the given block for each of the available plugin connectors You must have a Ubiquo::Config key :available_connectors for your plugin in order to use this. Also, the convention is that your connectors will be in a plugin.camelize::Connectors module

     # File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/test_case.rb, line 111
111:         def test_each_connector(plugin)
112:           Ubiquo::Config.context(plugin).get(:available_connectors).each do |conn|
113: 
114:             (class << self; self end).class_eval do
115:               eval "def test_with_connector name, &block\nblock_with_connector_load = Proc.new{\n\"\#{plugin.to_s.camelize}::Connectors::\#{conn.to_s.camelize}\".constantize.load!\nblock.bind(self).call\n}\ntest_without_connector \"\#{conn}_\\\#{name}\", &block_with_connector_load\nend\n"
116: 
117:               unless instance_methods.include?('test_without_connector')
118:                 alias_method :test_without_connector, :test
119:               end
120:               alias_method :test, :test_with_connector
121:             end
122:             yield
123:           end
124:         end
use_ubiquo_fixtures() click to toggle source

Loads the special set of ubiquo fixtures

     # File vendor/plugins/ubiquo_core/lib/ubiquo/extensions/test_case.rb, line 91
 91:         def use_ubiquo_fixtures
 92:           fixture_set_path = Rails.root.join('tmp', 'ubiquo_fixtures')
 93:           raise "Unable to find ubiquo fixtures [#{fixture_set_path}]" unless File.exists?(fixture_set_path)
 94:           fixture_files = Dir.entries(fixture_set_path).reject {|e| e =~ /^\./ || e !~ /\.yml$/}
 95:           raise "No fixtures found in #{fixture_set_path}, have you run rake test:fixture_sets:scan?" if fixture_files.empty?
 96:           @@original_fixture_path = ActiveSupport::TestCase.fixture_path
 97:           ActiveSupport::TestCase.fixture_path = fixture_set_path
 98:           fixture_symbols = fixture_files.map {|f| f.gsub('.yml', '').to_sym}
 99:           fixtures(*fixture_symbols)
100:         end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.