Sha256: 1c87e0368aaf0733af2ac95988f4697d0766cdee88110ef684600a13c7a49ea9

Contents?: true

Size: 845 Bytes

Versions: 1

Compression:

Stored size: 845 Bytes

Contents

# encoding: utf-8

require_relative '../../minitest_helper'
require 'strike/table'

describe Strike::Table do
  let(:hash) { { name: :test } }
  let(:table) { Strike::Table.new }

  subject { table }

  describe '#method_missing' do
    it 'should respond to missing methods' do
      subject.name(:test).wont_be_nil
      subject.test.wont_be_nil
    end
  end

  describe '#to_hash' do
    before { subject.name(:test) }

    it 'should save method calls as hash' do
      subject.to_hash.must_equal hash
    end
  end

  describe '#initialize' do
    let(:table) do
      Strike::Table.new do |t|
        t.name :test
      end
    end

    it 'should accept a block' do
      subject.to_hash.must_equal hash
    end
  end

  describe '#call' do
    it 'should respond with a Hash' do
      subject.call.must_equal Hash.new
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strike-0.4.0 spec/lib/strike/table_spec.rb