Sha256: 31c0a45b126848f13af24565a4724aee412937350173f9a8fb84192f7f69248a

Contents?: true

Size: 575 Bytes

Versions: 2

Compression:

Stored size: 575 Bytes

Contents

require 'sham/config/no_args'

describe Sham::Config::NoArgs do
  before(:all) do
    Object.send(:remove_const, :NoArgsTester) if defined?(NoArgsTester)
    class NoArgsTester
      attr_accessor :name

      def initialize(name = nil)
        self.name = name
      end
    end
  end

  let(:config){ subject.object(NoArgsTester) }

  it 'does not pass parameters by default' do
    NoArgsTester.should_receive(:new).with()
    config.options.sham
  end

  it 'allows passed parameters' do
    NoArgsTester.should_receive(:new).with(1)
    config.options(1).sham
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sham-1.1.0 spec/lib/sham/config/no_args_spec.rb
sham-1.0.3 spec/lib/sham/config/no_args_spec.rb