Sha256: e14b79611a76604126225f0e4640a7f99486e7dca0b1ef094ab877577382d86b

Contents?: true

Size: 793 Bytes

Versions: 18

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

module RailsBestPractices::Core
  describe Modules do
    it { should be_a_kind_of Array }

    context "Modules" do
      before do
        @mod = Mod.new("PostsHelper", [])
      end
      subject { Modules.new.tap { |modules| modules << @mod } }
      it "should add decendant to the corresponding module" do
        @mod.should_receive(:add_decendant).with("PostsController")
        subject.add_module_decendant("PostsHelper", "PostsController")
      end
    end

    context "Mod" do
      subject {
        Mod.new("UsersHelper", ["Admin"]).tap do |mod|
          mod.add_decendant("Admin::UsersController")
        end
      }
      its(:to_s) { should == "Admin::UsersHelper" }
      its(:decendants) { should == ["Admin::UsersController"] }
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rails_best_practices-1.14.4 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.14.3 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.14.2 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.14.1 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.14.0 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.8 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.5 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.4 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.3 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.2 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.1 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.13.0 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.12.0 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.11.1 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.11.0 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.10.1 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.10.0 spec/rails_best_practices/core/modules_spec.rb
rails_best_practices-1.9.1 spec/rails_best_practices/core/modules_spec.rb