source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/arts.rb
Ruby
mit
208
master
4,295
module Arts include ActionView::Helpers::PrototypeHelper include ActionView::Helpers::ScriptaculousHelper include ActionView::Helpers::JavaScriptHelper include ActionView::Helpers::UrlHelper include ActionView::Helpers::TagHelper def assert_rjs(action, *args, &block) respond_to?("assert_rjs_#{...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/ar_helper.rb
Ruby
mit
208
master
275
require 'rubygems' gem 'activerecord' require 'active_record' db_config_file = File.join(File.dirname(__FILE__) + '/../../config/database.yml') ActiveRecord::Base.configurations = YAML.load_file(db_config_file) ActiveRecord::Base.establish_connection('streamlined_unittest')
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/flexmock_patch.rb
Ruby
mit
208
master
1,003
require 'flexmock' class FlexMock class StubProxy # new_instances is a short cut method for overriding the behavior of any # instance created via a stubbed class object. def new_instances(*allocators, &block) @allocators = [:allocate, :new] if allocators.empty? fail ArgumentError, "any_instan...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/install.rb
Ruby
mit
208
master
680
require 'fileutils' BAR = "=" * 80 RUNNER_PATH = "script/multi_rails_runner" ACTUAL_PATH = File.expand_path(File.join(RAILS_ROOT, "/vendor/plugins/multi_rails/bin/multi_rails_runner.rb")) puts BAR puts "Installing multi_rails, and settig up /script/multi_rails_runner." FileUtils.symlink(ACTUAL_PATH, RUNNER_PATH, :fo...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/Rakefile
Ruby
mit
208
master
1,251
require 'rubygems' require 'hoe' require File.expand_path(File.join(File.dirname(__FILE__), "/lib/multi_rails")) load File.expand_path(File.join(File.dirname(__FILE__), "/tasks/multi_rails.rake")) Hoe.new('multi_rails', MultiRails::VERSION) do |p| p.rubyforge_name = 'multi-rails' p.author = 'Relevance' p.email =...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/core_extensions_test.rb
Ruby
mit
208
master
206
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "core extensions" do it "should extend Kernel" do Kernel.should.respond_to? :silence_warnings end end
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/multi_rails_init_test.rb
Ruby
mit
208
master
677
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "Rubygem test helper init" do setup { never_puts } it "should call gem and require rails" do MultiRails.expects(:gem_and_require_rails).once load File.expand_path(File.join(File.dirname(__FILE__), "../lib/mul...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/config_test.rb
Ruby
mit
208
master
2,362
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "Version Lookup in config" do it "should use argument version if passed in " do MultiRails::Loader.stubs(:all_rails_versions).returns(["1.2.3", "1.2.4"]) MultiRails::Config.version_lookup("1.2.3").should == "1....
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/install_test.rb
Ruby
mit
208
master
998
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "install hook" do setup { Object.const_set("RAILS_ROOT", "/src/rails_app") } teardown { Object.send(:remove_const, "RAILS_ROOT") if Object.const_defined?("RAILS_ROOT")} def load_install silence_warnings do ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/rails_app_helper_test.rb
Ruby
mit
208
master
4,812
require 'tempfile' require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "running a task" do setup { Object.const_set("RAILS_ROOT", "/src/rails_app")} teardown { Object.send(:remove_const, "RAILS_ROOT")} it "should call the bootstrap method if thats the task" do M...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/multi_rails_test_helper.rb
Ruby
mit
208
master
339
require 'test/unit' require 'test/spec' require 'mocha' require 'redgreen' unless Object.const_defined?("TextMate") require File.expand_path(File.join(File.dirname(__FILE__), "../lib/multi_rails")) class Test::Unit::TestCase def never_puts MultiRails::Loader.stubs(:puts) MultiRails::Loader.any_instance.stub...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/loader_test.rb
Ruby
mit
208
master
3,615
require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails_test_helper")) describe "loader" do setup do never_really_require_rails never_puts end it "should fall back to a default version to try" do MultiRails::Loader.any_instance.stubs(:display_rails_gem_used) stub_rails_requi...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/test/autotest/railsplugin.rb
Ruby
mit
208
master
857
# Discover our lib and tests for autotest'ing Rails Plugins class Autotest::Railsplugin < Autotest def initialize super @exceptions = /\/\./ @test_mappings = { /^lib\/(.*)\.rb$/ => proc { |filename, m| # p "match #{m[1]}" file = File.basename(filename).gsub("_", "_?").gsub(".rb", "")...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/lib/multi_rails.rb
Ruby
mit
208
master
378
require 'rubygems' require 'logger' files = %w(core_extensions config loader multi_rails_error rails_app_helper) files.each do |file| require File.expand_path(File.join(File.dirname(__FILE__), "multi_rails/#{file}")) end module MultiRails VERSION = '0.0.4' BAR = "=" * 80 # BEST CONSTANT EVAH def self.gem_an...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/lib/multi_rails/rails_app_helper.rb
Ruby
mit
208
master
3,621
require 'rake' module MultiRails module RailsAppHelper RAILS_DIRECTORIES = %w(app config public test) REQUIRE_LINE = %[require File.expand_path('config/rails_version') if File.exist?("config/rails_version.rb")].freeze class << self # Run the appropriate task or method for MultiRails ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/lib/multi_rails/loader.rb
Ruby
mit
208
master
1,910
module MultiRails class Loader attr_reader :version def self.logger @logger ||= Logger.new(STDOUT) end # Require and gem rails # Will use a default version if none is supplied def self.gem_and_require_rails(rails_version = nil) rails_version = MultiRails::Config.version_...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/lib/multi_rails/core_extensions.rb
Ruby
mit
208
master
1,282
# Add some nice to haves from ActiveSupport module Kernel def silence_warnings old_verbose, $VERBOSE = $VERBOSE, nil yield ensure $VERBOSE = old_verbose end end module HashExtensions def reverse_merge(other_hash) other_hash.merge(self) end def reverse_merge!(other_hash) replace(revers...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/lib/multi_rails/config.rb
Ruby
mit
208
master
1,322
module MultiRails # Simple config object class Config @weird_versions = { "2.0.0.PR" => "1.2.4.7794" } @rails_requires = %w[active_support active_record action_controller action_controller/test_process] class << self ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/tasks/multi_rails.rake
Ruby
mit
208
master
2,989
require 'rubygems' require 'rake' require 'rake/testtask' require File.expand_path(File.join(File.dirname(__FILE__), "/../lib/multi_rails")) # Enable overriding the already invoked flag of a Rake task class Rake::Task attr_accessor :already_invoked end namespace :test do namespace :multi_rails do desc "Run a...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/lib/multi_rails/bin/multi_rails_runner.rb
Ruby
mit
208
master
1,147
#!/usr/bin/env ruby require 'rake' require 'rake/testtask' require 'pathname' # Get the real path, to make sure if this file is symlinked we don't mess up absolute_current_dir = File.dirname(Pathname.new(__FILE__).realpath) require File.expand_path(File.join(absolute_current_dir, "../lib/multi_rails")) require File.e...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/meta_integration_test.rb
Ruby
mit
208
master
626
require File.expand_path(File.join(File.dirname(__FILE__), '../test_functional_helper')) require 'streamlined/controller' require 'streamlined/ui' require 'streamlined/integration_tests' require 'action_controller/integration' describe "MetaIntegration", ActionController::IntegrationTest do # TODO: need some way to ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/meta_functional_test.rb
Ruby
mit
208
master
633
require File.expand_path(File.join(File.dirname(__FILE__), '../test_functional_helper')) require 'streamlined/controller' require 'streamlined/ui' require 'streamlined/functional_tests' describe "MetaFunctional" do fixtures :people include Streamlined::FunctionalTests def setup setup_routes @controller =...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/active_record_extensions_test.rb
Ruby
mit
208
master
2,325
require File.expand_path(File.join(File.dirname(__FILE__), '../test_functional_helper')) require 'relevance/active_record_extensions' describe "ActiveRecordExtensions" do fixtures :people, :poets, :poems it "returns delegate target associations for delegate targets that are associations" ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/association_functional_test.rb
Ruby
mit
208
master
5,971
require File.expand_path(File.join(File.dirname(__FILE__), '../test_functional_helper')) include Streamlined::Column describe "AssociationFunctional" do fixtures :poets, :poems it "associables for non polymorphic association" do @association = Association.new(Poet.reflect_on_association(:poems), Poet, :inset_...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined_controller_functional_test.rb
Ruby
mit
208
master
16,555
require File.expand_path(File.join(File.dirname(__FILE__), '../test_functional_helper')) require 'streamlined/controller' require 'streamlined/ui' describe "StreamlinedController" do fixtures :people def setup setup_routes Streamlined::ReloadableRegistry.reset PeopleController.filters.clear @contr...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined_functional_test.rb
Ruby
mit
208
master
686
require File.expand_path(File.join(File.dirname(__FILE__), '../test_functional_helper')) describe "StreamlinedFunctional" do def setup Streamlined::ReloadableRegistry.reset end it "ui for" do assert_instance_of(Streamlined::UI, poem_ui = Streamlined.ui_for(Poem)) assert_instance_of(Streamlined:...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/reflection_test.rb
Ruby
mit
208
master
1,291
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_functional_helper')) require 'streamlined/reflection' describe "Streamlined::Reflection" do include Streamlined::Reflection attr_accessor :model def setup Streamlined::ReloadableRegistry.reset end it "reflect on scalars" do ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/ui_functional_test.rb
Ruby
mit
208
master
23,930
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_functional_helper')) require 'streamlined/reflection' describe "Streamlined::UIFunctional" do def setup Streamlined::ReloadableRegistry.reset @poet_ui = Streamlined.ui_for(Poet) @poem_ui = Streamlined.ui_for(Poem) do list_column...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/helper_functional_test.rb
Ruby
mit
208
master
592
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_functional_helper')) require 'streamlined/helpers/link_helper' describe "Streamlined::HelperFunctional" do fixtures :people def setup stock_controller_and_view end it "invisible link to" do assert_equal '<a href="/people/show/1" st...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/view/render_methods_test.rb
Ruby
mit
208
master
795
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/helpers/link_helper' describe "Streamlined::View::RenderMethods" do def setup stock_controller_and_view end it "convert partial options for managed partial" do assert_true @view.send(:ma...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/column/base_test.rb
Ruby
mit
208
master
3,958
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/helpers/link_helper' describe "Streamlined::Column::Base" do fixtures :people # s/b setup but for some reason rcov doesn't call setup (this class only) def ui unless @ui stock_controll...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/controller/relationship_methods_functional_test.rb
Ruby
mit
208
master
936
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) describe "RelationshipMethodsFunctional" do def setup Streamlined::ReloadableRegistry.reset @controller = PeopleController.new class <<@controller public :crud_context=, :context_column end @perso...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/controller/enumeration_methods_test.rb
Ruby
mit
208
master
2,711
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/controller/enumeration_methods' describe "Streamlined::Controller::EnumerationMethods" do include Streamlined::Controller::EnumerationMethods attr_accessor :instance it "edit enumeration" do ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/controller/crud_methods_test.rb
Ruby
mit
208
master
4,340
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/controller/crud_methods' require 'streamlined/controller/filter_methods' describe "Streamlined::Controller::CrudMethods" do include Streamlined::Controller::CrudMethods include Streamlined::Controlle...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/controller/crud_methods_create_test.rb
Ruby
mit
208
master
2,413
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/controller/crud_methods' require 'streamlined/controller/filter_methods' describe "create with a before_streamlined_create filter" do attr_reader :controller setup do stock_controller_and_view(Po...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/controller/render_methods_funtional_test.rb
Ruby
mit
208
master
3,271
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/controller/render_methods' describe "RenderMethodsFunctional" do def setup @controller = PeopleController.new # Took a while to find this, setting layout=false was not good enough class <<@...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/controller/filter_methods_functional_test.rb
Ruby
mit
208
master
21,247
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/controller/filter_methods' include Streamlined::Controller::FilterMethods describe "FilterMethodsFunctional" do def setup @controller = PeopleController.new # Took a while to find this, setti...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/helpers/window_link_helper_test.rb
Ruby
mit
208
master
8,612
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/helpers/window_link_helper' require "#{RAILS_ROOT}/app/controllers/application" class FoobarController < ApplicationController end describe "Streamlined::WindowLinkHelper" do include ActionView::Helpe...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/helpers/table_helper_functional_test.rb
Ruby
mit
208
master
1,915
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/helpers/link_helper' describe "Streamlined::Helpers::TableHelperFunctional" do fixtures :people def setup stock_controller_and_view end it "no buttons" do @view.send(:model_ui).table_row...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/helpers/link_helper_test.rb
Ruby
mit
208
master
7,666
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/helpers/link_helper' describe "Streamlined::Helpers::LinkHelper" do fixtures :people, :phone_numbers def setup stock_controller_and_view end it "guess show link for" do assert_equal...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/helpers/breadcrumb_helper_test.rb
Ruby
mit
208
master
2,553
require File.expand_path(File.join(File.dirname(__FILE__), "../../../test_functional_helper")) require "streamlined/helpers/breadcrumb_helper" describe "Streamlined::BreadcrumbHelper" do fixtures :people def setup stock_controller_and_view end it "streamlined_breadcrumb defaults to false" do assert !...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/streamlined/helpers/filter_helper_functional_test.rb
Ruby
mit
208
master
5,209
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_functional_helper')) require 'streamlined/helpers/filter_helper' describe "Streamlined::Helpers::FilterHelperFunctional" do fixtures :people, :poems def setup stock_controller_and_view Streamlined::ReloadableRegistry.reset @pe...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/functional/relevance/macro_reflection_test.rb
Ruby
mit
208
master
629
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_functional_helper')) require 'relevance/macro_reflection' describe "Relevance::ActiveRecord::MacroReflection" do it "has many" do assoc = Poet.reflect_on_association(:poems) assert_true assoc.has_many? assert_false assoc.has_one? ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/db/schema.rb
Ruby
mit
208
master
1,295
# This file is autogenerated. Instead of editing this file, please use the # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. ActiveRecord::Schema.define() do create_table "articles", :force => true do |t| t.column "title", :string t...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined_test.rb
Ruby
mit
208
master
2,799
require File.expand_path(File.join(File.dirname(__FILE__), '/../test_helper')) describe "Streamlined" do before do Streamlined::PermanentRegistry.reset Streamlined::ReloadableRegistry.reset end after do Streamlined::PermanentRegistry.reset Streamlined::Reloada...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/environment_test.rb
Ruby
mit
208
master
1,572
require File.expand_path(File.join(File.dirname(__FILE__), '/../test_helper')) describe "StreamlinedEnvironment" do it "pagination is available" do assert defined?(ActionController::Pagination) end it "should require pagination plugin" do ignore_any_dynamic_constants_set Streamlined::Environme...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/extensions/hash_smart_merge_test.rb
Ruby
mit
208
master
1,252
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) describe "HashSmartMerge" do it "smart merge!" do one = { :foo => "123", :bar => "456" } two = { :bar => "789", :bat => "012" } one.smart_merge!(two) expected = { :foo => "123", :bar => ["456", "789"], :bat => "012" }...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/extensions/array_conversions_test.rb
Ruby
mit
208
master
397
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) describe "ArrayConversions" do it "to 2d array" do assert_equal [[1, 1], [2, 2]], [1, 2].to_2d_array expected = [['A', 1], ['B', 2], ['C', 3]] assert_equal expected, { 'A' => 1, 'B' => 2, 'C' => 3 }.to_2d_array a...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/hash_init_test.rb
Ruby
mit
208
master
694
require File.dirname(__FILE__) + '/../../test_helper' describe "Relevance::HashInit" do def setup @c = Class.new do attr_accessor :one, :two include HashInit end end it "initialize" do inst = @c.new(:one=>1, :two=>2) assert_equal(1, inst.one) assert_equal(2, inst.two) end ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/module_additions_test.rb
Ruby
mit
208
master
1,504
require File.dirname(__FILE__) + '/../../test_helper' describe "Relevance::ModuleAdditions" do class TestMe attr_accessor :helper delegates :jump, :to=>:helper delegates :run, :to=>:helper, :default=>nil delegates :fly, :zoom, :to=>:helper, :method=>:soar delegates :secret, :hidden, :to=>:help...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/string_additions_test.rb
Ruby
mit
208
master
562
require File.dirname(__FILE__) + '/../../test_helper' require 'relevance/string_additions' describe "Relevance::StringAdditions" do it "const for name" do assert_equal String, 'String'.to_const assert_equal String, '::String'.to_const assert_equal false, 'Flibberty'.to_const assert_equal :custom, 'Fl...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/active_record_extensions_test.rb
Ruby
mit
208
master
2,180
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) require 'relevance/active_record_extensions' describe "ActiveRecordExtensions" do def setup @inst = Object.new @cls = Object.new @inst.extend(Relevance::ActiveRecordExtensions::InstanceMethods) @cls.extend(Relevance::...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/symbol_additions_test.rb
Ruby
mit
208
master
246
require File.dirname(__FILE__) + '/../../test_helper' require 'relevance/symbol_additions' describe "Relevance::SymbolAdditions" do it "titleize" do assert_equal "Foo", :foo.titleize assert_equal "Foo Bar", :foo_bar.titleize end end
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/csv_test.rb
Ruby
mit
208
master
1,004
require File.dirname(__FILE__) + '/../../test_helper' describe "Enumerable" do it "array header" do assert_equal("Upper,Normal\nA,a\nB,b\n", ['a','b'].to_csv([:upcase, :to_str], :header=>["Upper", "Normal"])) end it "array header with different separator" do assert_equal("Upper;Normal\nA;a\nB;b\n...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/relevance/module_test.rb
Ruby
mit
208
master
519
require File.dirname(__FILE__) + '/../../test_helper' describe "Relevance::ModuleExtensions" do class TestMe def callme(*args); "foo"; end end it "wrap method" do @inst = TestMe.new assert_equal "foo", @inst.callme assert_equal "foo", @inst.callme(1) @inst.class.wrap_method :callme do |ol...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/relevance_extensions_tasks_test.rb
Ruby
mit
208
master
3,504
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) require 'rake' # Test the install process that runs on install that copies over static files required by Streamlined describe "Streamlined::RakeTasks" do RAKE_FILE = File.join(File.dirname(__FILE__), '../../../tasks/relevance_extensions...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/helper_test.rb
Ruby
mit
208
master
888
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) require 'ostruct' describe "Streamlined::Helper" do def setup @inst = OpenStruct.new @inst.extend Streamlined::Helper end it "relationship div id" do rel = flexmock(:name => "relati...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/reloadable_registry_test.rb
Ruby
mit
208
master
893
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) describe "Streamlined::ReloadableRegistry" do before do (@rr = Streamlined::ReloadableRegistry).reset @clazz = Class.new end it "should create and cache UI classes based on class name"...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/render_methods_test.rb
Ruby
mit
208
master
1,780
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) require 'streamlined/render_methods' describe "Streamlined::RenderMethods#specific_template_exists" do include Streamlined::RenderMethods it "specific template exists?" do assert specific_template_exists?("templates/template") ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/ui_test.rb
Ruby
mit
208
master
10,539
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) require 'streamlined/ui' describe "RelevanceModuleHelpers" do def setup @inst = Relevance::ModuleHelper end it "reader from options" do assert_equal("@foo", @inst.reader_from_options("foo")) assert_equal("defined?(@foo)...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/breadcrumb_test.rb
Ruby
mit
208
master
772
require File.expand_path(File.join(File.dirname(__FILE__), '../../test_helper')) require 'streamlined/breadcrumb' describe "Streamlined::Breadcrumb" do include Streamlined::Breadcrumb it "node for list crud context" do flexmock(self).should_receive(:link_to).with("Flex Mocks", :controller => "flex_mocks", :...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/ui/deprecated_test.rb
Ruby
mit
208
master
515
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/ui/deprecated' describe "Streamlined::Deprecated" do include Streamlined::DeprecatedUIClassMethods it "deprecated class methods" do methods = deprecated_class_methods assert methods.is_a?(Set) as...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/view/base_test.rb
Ruby
mit
208
master
559
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/view/base' describe "Streamlined::View::Base" do class Subclass < Streamlined::View::Base; end def setup @base = Streamlined::View::Base.new end it "id fragment" do assert_equal "Base", @base....
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/view/render_methods_test.rb
Ruby
mit
208
master
1,507
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/view/render_methods' describe "Streamlined::View::RenderMethods" do def render(*args) nil end include Streamlined::View::RenderMethods it "controller name" do flexmock(self).should_receive(:co...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/view/show_views_test.rb
Ruby
mit
208
master
1,650
# def graph_data(item, relationship) # must_have_sparklines! # if block_given? # return yield(item, relationship) # else # case @options[:type].to_sym # when :pie # return [(item.send(relationship.name).size.to_f/relationship.klass.count.to_f)*100] # else # return [0] # end # end...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/column/base_test.rb
Ruby
mit
208
master
8,206
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/column/association' require 'streamlined/column/active_record' require 'streamlined/column/addition' include Streamlined::Column include Streamlined::Context describe "Streamlined::Column::Base" do def setup ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/column/addition_test.rb
Ruby
mit
208
master
1,451
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/column/addition' describe "Streamlined::Column::Addition" do include Streamlined::Column it "equal" do a1 = Addition.new(:foo_bar, nil) a2 = Addition.new(:foo_bar, nil) a3 = Addition.new(:bar, ni...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/column/association_test.rb
Ruby
mit
208
master
7,588
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/column/association' include Streamlined::Column describe "Streamlined::Column::Association" do def setup @ar_assoc = flexmock(:name => 'some_name', :class_name => 'SomeClass') @model = flexmock(:name ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/column/active_record_test.rb
Ruby
mit
208
master
10,253
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/column/addition' describe "Streamlined::Column::ActiveRecord" do include Streamlined::Column def setup ar_column = flexmock(:name => 'column') model = flexmock(:name => 'model') @class_under_tes...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/quick_add_methods_test.rb
Ruby
mit
208
master
4,232
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller/quick_add_methods' class StubModel attr_accessor :attrs def initialize(attrs={}) @attrs = attrs end def name "a stub model" end end class StubController < ActionController::Base incl...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/options_methods_test.rb
Ruby
mit
208
master
1,144
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller/options_methods' describe "Streamlined::Controller::OptionsMethods" do include Streamlined::Controller::OptionsMethods it "merge count or find options" do mock_count_or_find_options(:condition...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/crud_methods_test.rb
Ruby
mit
208
master
1,036
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller/crud_methods' describe "Streamlined::Controller::CrudMethods has_manies support" do before do @controller = OpenStruct.new @controller.extend Streamlined::Controller::CrudMethods @controll...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/db_action_methods_test.rb
Ruby
mit
208
master
958
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller/callbacks' class StubController < ActionController::Base include Streamlined::Controller::Callbacks end describe "Streamlined::Controller::Callbacks" do def setup @controller = StubController...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/controller_test.rb
Ruby
mit
208
master
1,826
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller' require "#{RAILS_ROOT}/app/controllers/application" class FooController < ApplicationController end describe "Streamlined::Controller" do include Streamlined::Controller::ClassMethods before do ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/render_methods_test.rb
Ruby
mit
208
master
3,876
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller/render_methods' describe "Streamlined::Controller::RenderMethods" do include Streamlined::Controller::RenderMethods attr_accessor :instance, :filters # begin stub methods def controller_name ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/controller/relationship_methods_test.rb
Ruby
mit
208
master
4,221
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/controller/relationship_methods' class StubClass def self.find(value) 'new_item' end end describe "Streamlined::Controller::RelationshipMethods" do def setup @inst = Object.new class <<@inst ...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/helpers/filter_helper_test.rb
Ruby
mit
208
master
303
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/helpers/filter_helper' describe "Streamlined::FilterHelper" do include Streamlined::Helpers::FilterHelper it "advanced filtering defaults to false" do assert !advanced_filtering end end
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/helpers/table_helper_test.rb
Ruby
mit
208
master
795
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/helpers/table_helper' describe "Streamlined::TableHelper" do include Streamlined::Helpers::TableHelper attr_accessor :model_ui it "should render table filter when show_table_filter? returns true" do @m...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/helpers/header_helper_test.rb
Ruby
mit
208
master
2,113
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/helpers/header_helper' describe "HeaderHelper" do class FancyController include Streamlined::Helpers::HeaderHelper attr_accessor :instance, :model_name, :crud_context end def setup @controll...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/helpers/form_helper_test.rb
Ruby
mit
208
master
2,270
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/helpers/form_helper' describe "Streamlined::FormHelper" do include Streamlined::Helpers::FormHelper it "unassigned if allowed with model that has no validations" do model_class, column = flexmock, flexmo...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/components/select_test.rb
Ruby
mit
208
master
1,570
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) include Streamlined::Components describe "Select component" do it "should fail fast if there are missing args" do lambda{Select.render}.should.raise(ArgumentError) end it "renders a select tag plus a hidden input field w...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/context/request_context_test.rb
Ruby
mit
208
master
1,079
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) include Streamlined::Context describe "Streamlined::Context::RequestContext" do it "ascending" do o = RequestContext.new(:sort_order=>'ASC', :sort_column=>"name") assert o.sort_ascending? assert_equal({:order=>"name ASC"}...
github
relevance/streamlined
https://github.com/relevance/streamlined
test/unit/streamlined/context/controller_context_test.rb
Ruby
mit
208
master
772
require File.expand_path(File.join(File.dirname(__FILE__), '../../../test_helper')) require 'streamlined/ui' describe "Streamlined::Context::ControllerContext" do def setup @context = Streamlined::Context::ControllerContext.new(String) end it "model ui" do assert_instance_of Streamlined::UI, @conte...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
Appraisals
Ruby
mit
208
master
343
appraise "active_record-3" do gem "rails", ">= 3.0" gem "sqlite3", "~> 1.3.8" end appraise "active_record-4" do gem "rails", ">= 4.0" gem "sqlite3", "~> 1.3.8" end appraise "mongoid-3" do gem "rails", ">= 3.0" gem "mongoid", "~> 3.1.6" end appraise "mongoid-4" do gem "rails", ">= 4.0" gem "mo...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
sprig.gemspec
Ruby
mit
208
master
1,257
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "sprig/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "sprig" s.version = Sprig::VERSION s.authors = ["Lawson Kurtz", "Ryan Foster"] s.email = ["lawson.ku...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/sprig_spec.rb
Ruby
mit
208
master
12,321
require 'spec_helper' require 'open-uri' RSpec.describe "Seeding an application" do let(:missing_record_error) do if defined?(ActiveRecord) && Post < ActiveRecord::Base ActiveRecord::RecordNotFound elsif defined?(Mongoid) && Post < Mongoid::Document Mongoid::Errors::DocumentNotFound end end...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/spec_helper.rb
Ruby
mit
208
master
2,083
ENV["RAILS_ENV"] ||= 'test' require 'simplecov' require 'coveralls' SimpleCov.formatter = Coveralls::SimpleCov::Formatter SimpleCov.start "rails" require "rails" require "webmock" require "vcr" require "pry" require "generator_spec" require "sprig" include Sprig::Helpers Dir[File.dirname(__FILE__) + '/support/**/*...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/sprig_shared_spec.rb
Ruby
mit
208
master
12,345
require 'spec_helper' require 'open-uri' RSpec.describe "Seeding an application with shared seeds" do let(:missing_record_error) do if defined?(ActiveRecord) && Post < ActiveRecord::Base ActiveRecord::RecordNotFound elsif defined?(Mongoid) && Post < Mongoid::Document Mongoid::Errors::DocumentNotF...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/adapters/active_record.rb
Ruby
mit
208
master
1,376
require "database_cleaner" RSpec.configure do |c| c.before(:suite) do DatabaseCleaner[:active_record].strategy = :transaction DatabaseCleaner[:active_record].clean_with(:truncation) end c.before(:each) do DatabaseCleaner[:active_record].start end c.after(:each) do DatabaseCleaner[:active_re...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/adapters/mongoid.rb
Ruby
mit
208
master
393
require "database_cleaner" RSpec.configure do |c| c.before(:suite) do DatabaseCleaner[:mongoid].strategy = :truncation DatabaseCleaner[:mongoid].clean_with(:truncation) end c.before(:each) do DatabaseCleaner[:mongoid].start end c.after(:each) do DatabaseCleaner[:mongoid].clean end end # ...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/support/shared_examples/a_logging_entity.rb
Ruby
mit
208
master
290
shared_examples_for "a logging entity" do let(:message) { 'A log message.' } [ :debug, :info, :warn, :error ].each do |level| it "can log a #{level}" do log_should_receive(level, with: message) subject.send("log_#{level}", message) end end end
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/support/helpers/logger_mock.rb
Ruby
mit
208
master
383
module LoggerMock def log_should_receive(level, options) expect(Sprig.logger).to receive(level).with(send("log_#{level}_text", options.fetch(:with))) end def log_debug_text(text) blue_text(text) end def log_info_text(text) green_text(text) end def log_warn_text(text) orange_text(text) ...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/support/helpers/colored_text.rb
Ruby
mit
208
master
240
module ColoredText def blue_text(text) "\e[34m#{text}\e[0m" end def green_text(text) "\e[32m#{text}\e[0m" end def orange_text(text) "\e[33m#{text}\e[0m" end def red_text(text) "\e[31m#{text}\e[0m" end end
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/feature/configurations_spec.rb
Ruby
mit
208
master
729
require 'spec_helper' RSpec.describe "Configurating Sprig" do before do stub_rails_root '~' stub_rails_env 'development' end it "can set the directory" do expect(Sprig.configuration.directory.to_path).to eq('~/db/seeds/development') Sprig.configure do |c| c.directory = 'seed_files' en...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/lib/sprig_spec.rb
Ruby
mit
208
master
2,790
require 'spec_helper' RSpec.describe Sprig do let(:configuration) { double('Configuration') } before do allow(Sprig::Configuration).to receive(:new).and_return(configuration) end describe '.adapter' do it { expect(described_class).to respond_to(:adapter).with(0).arguments } it { expect(described...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/lib/sprig/source_spec.rb
Ruby
mit
208
master
582
require 'spec_helper' RSpec.describe Sprig::NullRecord do let(:error_msg) { 'Something bad happened.' } subject { described_class.new(error_msg) } describe "#new" do it "logs an error upon initialization" do log_should_receive(:error, with: "#{error_msg} (Substituted with NullRecord)") subject ...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/lib/sprig/directive_list_spec.rb
Ruby
mit
208
master
692
require 'spec_helper' RSpec.describe Sprig::DirectiveList do describe "#add_seeds_to_hopper" do let(:hopper) { Array.new } let(:directive) { double('directive') } let(:seed_factory) { double('seed_factory') } subject { described_class.new(Post) } before do allow(Sprig::Directive...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/lib/sprig/configuration_spec.rb
Ruby
mit
208
master
846
require 'spec_helper' RSpec.describe Sprig::Configuration do before do stub_rails_root '~' stub_rails_env 'development' end describe "#directory" do it "returns db/seeds/:env by default" do expect(subject.directory.to_path).to eq('~/db/seeds/development') end it "returns a custom dire...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/lib/sprig/process_notifier_spec.rb
Ruby
mit
208
master
2,709
require 'spec_helper' RSpec.describe Sprig::ProcessNotifier do it_behaves_like "a logging entity" do subject { described_class.new } end describe "#success" do let(:seed) { double('Seed', success_log_text: 'I am a teapot.') } it "logs the seed's success message" do log_should_receive(:info, w...
github
vigetlabs/sprig
https://github.com/vigetlabs/sprig
spec/lib/sprig/directive_spec.rb
Ruby
mit
208
master
2,248
require 'spec_helper' RSpec.describe Sprig::Directive do module Users class Admin < User end end describe "#klass" do context "given a class" do subject { described_class.new(Post) } it "returns the class" do expect(subject.klass).to eq(Post) end end context "giv...