Sha256: 7f5b2d3077fad629c5d2b00d3531e757e1b30366bea723e0ba7bbf533452bf89

Contents?: true

Size: 678 Bytes

Versions: 9

Compression:

Stored size: 678 Bytes

Contents

require "spec_helper"

describe TableCloth::Extensions::Actions::ActionCollection do
  subject { described_class.new }

  context "#action" do
    it "adds an action" do
      subject.action { }
      expect(subject).to have(1).actions
    end

    it "adds an action with options" do
      subject.action(option: "something") { }
      expect(subject.actions.first.options[:option]).to eq("something")
    end
  end

  context "#actions" do
    before(:each) do
      subject.action { }
    end

    it "returns a list of actions" do
      subject.actions.each do |action|
        expect(action).to be_kind_of TableCloth::Extensions::Actions::Action
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
table_cloth-0.4.3 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.4.2 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.4.1 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.4.0 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.3.2 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.3.1.alpha1 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.3.0.beta3 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.3.0.beta2 spec/lib/extensions/actions/action_collection_spec.rb
table_cloth-0.3.0.beta1 spec/lib/extensions/actions/action_collection_spec.rb