Sha256: b39624557370a7e0ceb58c06860a002b848cd39b01ccc827c660529588a1c789

Contents?: true

Size: 544 Bytes

Versions: 7

Compression:

Stored size: 544 Bytes

Contents

require "spec_helper"

module Chanko
  describe Helper do
    describe ".define" do
      after do
        described_class.class_eval do
          remove_method :__example_unit_test rescue nil
        end
      end

      let(:view) do
        Class.new { include Chanko::Helper }.new
      end

      it "defines helper methods with special prefix" do
        described_class.define(:example_unit) do
          def test
            "test"
          end
        end
        view.__example_unit_test.should == "test"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
chanko-2.0.6 spec/chanko/helper_spec.rb
chanko-2.0.5 spec/chanko/helper_spec.rb
chanko-2.0.4 spec/chanko/helper_spec.rb
chanko-2.0.3 spec/chanko/helper_spec.rb
chanko-2.0.2 spec/chanko/helper_spec.rb
chanko-2.0.1 spec/chanko/helper_spec.rb
chanko-2.0.0 spec/chanko/helper_spec.rb