Sha256: 4aaf18ab44564108064faed67bc2e2fb1242e4c10500cb2a77009d07337efeb9

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

require "spec_helper"

module Nyanko
  module Unit
    describe ScopeFinder do
      describe ".find(identifier)" do
        context "when identifier is a class" do
          it "returns identifier with no change" do
            identifier = ActionView::Base
            described_class.find(identifier).should == ActionView::Base
          end
        end

        context "when identifier is a reserved label" do
          it "returns reserved class for that" do
            identifier = :view
            described_class.find(identifier).should == ActionView::Base
          end
        end

        context "when identifier is a string that means a class" do
          it "returns class of that string" do
            identifier = "ActionView::Base"
            described_class.find(identifier).should == ActionView::Base
          end
        end

        context "when no class is found" do
          it "returns nil" do
            identifier = "Non::Existent::Class"
            described_class.find(identifier).should == nil
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nyanko-0.0.9 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.8 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.7 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.6 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.5 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.4 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.3 spec/nyanko/unit/scope_finder_spec.rb
nyanko-0.0.1 spec/nyanko/unit/scope_finder_spec.rb