Sha256: b49145807f4b7e9ec1b4686f755c1de896d7b912bf1f4fc14fe3acca830611d4

Contents?: true

Size: 1.26 KB

Versions: 13

Compression:

Stored size: 1.26 KB

Contents

# -*- coding: UTF-8 -*-
#
# Copyright 2014 PagerDuty, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'spec_helper'

describe LitaGithub::Filters do
  include LitaGithub::Filters

  describe '.func_disabled?' do
    before do
      @cfg = double('Lita::Configuration', test_enabled: true)
      allow(self).to receive(:config).and_return(@cfg)
    end

    context 'when enabled' do
      it 'should return false' do
        expect(func_disabled?(:test)).to be_falsey
      end
    end

    context 'when disabled' do
      before do
        @cfg = double('Lita::Configuration', test_enabled: false)
        allow(self).to receive(:config).and_return(@cfg)
      end

      it 'should return true' do
        expect(func_disabled?(:test)).to be_truthy
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lita-github-0.3.0 spec/unit/lita-github/filters_spec.rb
lita-github-0.2.2 spec/unit/lita-github/filters_spec.rb
lita-github-0.2.1 spec/unit/lita-github/filters_spec.rb
lita-github-0.2.0 spec/unit/lita-github/filters_spec.rb
lita-github-0.1.2 spec/unit/lita-github/filters_spec.rb
lita-github-0.1.1 spec/unit/lita-github/filters_spec.rb
lita-github-0.1.0 spec/unit/lita-github/filters_spec.rb
lita-github-0.0.16 spec/unit/lita-github/filters_spec.rb
lita-github-0.0.15 spec/unit/lita-github/filters_spec.rb
lita-github-0.0.14 spec/unit/lita-github/filters_spec.rb
lita-github-0.0.13 spec/unit/lita-github/filters_spec.rb
lita-github-0.0.12 spec/unit/lita-github/filters_spec.rb
lita-github-0.0.11 spec/unit/lita-github/filters_spec.rb