Sha256: 3f263d8a65f7e03d65e202918a2fd0137e86d81fb4aec71c10a35951f7e75f64

Contents?: true

Size: 544 Bytes

Versions: 3

Compression:

Stored size: 544 Bytes

Contents

require "spec_helper"

module Nyanko
  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 Nyanko::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

3 entries across 3 versions & 1 rubygems

Version Path
nyanko-0.0.9 spec/nyanko/helper_spec.rb
nyanko-0.0.8 spec/nyanko/helper_spec.rb
nyanko-0.0.7 spec/nyanko/helper_spec.rb