source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/steps_spec.rb
Ruby
mit
91
master
440
# frozen_string_literal: true RSpec.describe Protos::Steps do subject do described_class.new(vertical: true) do |steps| steps.step { "Step 1" } end end before { render subject } it "renders the steps" do expect(page).to have_css("ol") expect(page).to have_content("Step 1") end it "...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/drawer_spec.rb
Ruby
mit
91
master
705
# frozen_string_literal: true RSpec.describe Protos::Drawer do subject { page } before do render described_class.new(id: "some_id") do |drawer| drawer.content do drawer.trigger { "Trigger" } drawer.plain "Main content" end drawer.side do drawer.plain "Sidebar content...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command_spec.rb
Ruby
mit
91
master
1,072
# frozen_string_literal: true RSpec.describe Protos::Command do subject do described_class.new do |command| command.trigger { "Trigger" } command.dialog do command.list do command.input(placeholder: "Search...") command.empty { "No results found" } command.item {...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/tailwind_merge_spec.rb
Ruby
mit
91
master
598
# frozen_string_literal: true RSpec.describe Protos::TailwindMerge do describe "#merge" do it "merges with daisyui context" do merged = subject.merge(%w[card-sm card-md]) expect(merged).to eq("card-md") end it "merges alert colors" do merged = subject.merge(%w[alert alert-soft alert-i...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/hero_spec.rb
Ruby
mit
91
master
579
# frozen_string_literal: true RSpec.describe Protos::Hero do subject do described_class.new( style: "background-image: url('https://example.com/image.jpg')" ) do |hero| hero.overlay(class: "opacity-90") hero.content { "Hero content" } end end before { render subject } it "render...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/carousel_spec.rb
Ruby
mit
91
master
813
# frozen_string_literal: true RSpec.describe Protos::Carousel do subject do described_class.new( vertical: true, snap_to: :end ) do |carousel| carousel.item { "Item one" } carousel.item { "Item two" } carousel.actions do carousel.button { "Previous" } carousel.bu...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/list_spec.rb
Ruby
mit
91
master
450
# frozen_string_literal: true RSpec.describe Protos::List do subject do described_class.new do |list| list.item { "Item one" } list.item { "Item two" } end end before { render subject } it "renders the list" do expect(page).to have_css("ul") expect(page).to have_content("Item one"...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/floating_action_button_spec.rb
Ruby
mit
91
master
1,349
# frozen_string_literal: true RSpec.describe Protos::FloatingActionButton do subject { page } context "with a main action" do before do render described_class.new(flower: true) do |fba| fba.open_button { "Click me" } fba.main_action { "Main Action" } fba.action { "Action 1" } ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/popover_spec.rb
Ruby
mit
91
master
872
# frozen_string_literal: true RSpec.describe Protos::Popover do subject do described_class.new( position: :top, animation: :shift_away, duration: [200, 200], hide_on_click: :toggle, z_index: 10, delay: [100, 100], trigger: %i[mouseenter focus] ) end before { ren...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/menu_spec.rb
Ruby
mit
91
master
507
# frozen_string_literal: true RSpec.describe Protos::Menu do subject do described_class.new(class: "custom") do |list| list.item { "Item one" } list.item { "Item two" } end end before { render subject } it "renders the list" do expect(page).to have_css("ul") expect(page).to have_c...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/component_spec.rb
Ruby
mit
91
master
2,861
# frozen_string_literal: true RSpec.describe Protos::Component do before do stub_const( "BaseComponent", Class.new(Protos::Component) do option :some_property, default: -> { "default" } def view_template h1(**attrs) { "hello" } end private def theme ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/breadcrumbs_spec.rb
Ruby
mit
91
master
609
# frozen_string_literal: true RSpec.describe Protos::Breadcrumbs do subject { page } before do render described_class.new do |crumbs| crumbs.crumb { crumbs.a(href: "#") { "Item one" } } crumbs.crumb { "Item two" } end end context "content" do it { is_expected.to have_link("Item one") ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/alert_spec.rb
Ruby
mit
91
master
678
# frozen_string_literal: true RSpec.describe Protos::Alert do subject { page } before do render described_class.new(color: :info, variant: :soft) do |alert| alert.plain "alert" alert.icon { "X" } end end context "styles" do it { is_expected.to have_css(".alert") } it { is_expected...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/combobox_spec.rb
Ruby
mit
91
master
954
# frozen_string_literal: true RSpec.describe Protos::Combobox do subject do described_class.new do |combo| combo.trigger { "Trigger" } combo.content do combo.input(placeholder: "Search...") combo.empty { "No results found" } combo.item { "Item one" } combo.group do ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/swap_spec.rb
Ruby
mit
91
master
710
# frozen_string_literal: true RSpec.describe Protos::Swap do subject { page } before do render described_class.new(input_options: { value: "bob" }) do |swap| swap.on { "Swap on" } swap.off { "Swap off" } end end context "content" do it { is_expected.to have_css("label") } it { is_...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/avatar_spec.rb
Ruby
mit
91
master
752
# frozen_string_literal: true RSpec.describe Protos::Avatar do subject do described_class.new( placeholder: true, shape: :circle, indicator: :online ) do |avatar| avatar.plain "NT" end end before { render subject } it "renders an avatar" do expect(page).to have_css("di...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/status_spec.rb
Ruby
mit
91
master
415
# frozen_string_literal: true RSpec.describe Protos::Status do subject do described_class.new(size: :lg, type: :primary) { "Good" } end before { render subject } it "renders the status" do expect(page).to have_css("div") expect(page).to have_content("Good") end it "renders the styles" do ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/button_spec.rb
Ruby
mit
91
master
903
# frozen_string_literal: true RSpec.describe Protos::Button do subject { page } before do render described_class.new( color: :success, variant: :dash, active: true, disabled: true, size: :lg, wide: true, block: true, shape: :square ) do |button| button...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/hero/overlay_spec.rb
Ruby
mit
91
master
280
# frozen_string_literal: true RSpec.describe Protos::Hero::Overlay do before do render described_class.new end it "renders the component" do expect(page).to have_css("div") end it "renders the style" do expect(page).to have_css(".hero-overlay") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/hero/content_spec.rb
Ruby
mit
91
master
348
# frozen_string_literal: true RSpec.describe Protos::Hero::Content do before do render described_class.new { "Hero content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Hero content") end it "renders the style" do expect(page).to have_css...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/dropdown/item_spec.rb
Ruby
mit
91
master
254
# frozen_string_literal: true RSpec.describe Protos::Dropdown::Item do before do render described_class.new { "Content 1" } end it "renders the item" do expect(page).to have_css "li" expect(page).to have_content "Content 1" end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/dropdown/trigger_spec.rb
Ruby
mit
91
master
272
# frozen_string_literal: true RSpec.describe Protos::Dropdown::Trigger do subject { page } before do render described_class.new(class: "custom") { "Trigger" } end it { is_expected.to have_css(".custom") } it { is_expected.to have_content("Trigger") } end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/dropdown/menu_spec.rb
Ruby
mit
91
master
284
# frozen_string_literal: true RSpec.describe Protos::Dropdown::Menu do before do render described_class.new(as_template: false) do |menu| menu.item { "Item 1" } end end it "renders the template" do expect(page).to have_css("div", visible: :hidden) end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/modal/trigger_spec.rb
Ruby
mit
91
master
354
# frozen_string_literal: true RSpec.describe Protos::Modal::Trigger do before do render described_class.new { "Open" } end it "renders the button" do expect(page).to have_button expect(page).to have_content("Open") end it "adds the stimulus action" do expect(page).to have_css("[data-action=...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/modal/dialog_spec.rb
Ruby
mit
91
master
454
# frozen_string_literal: true RSpec.describe Protos::Modal::Dialog do before do render described_class.new { "Content" } end it "renders the content" do expect(page).to have_content("Content") end it "adds the utility classes" do expect(page).to have_css(".modal") expect(page).to have_css("...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/modal/close_button_spec.rb
Ruby
mit
91
master
380
# frozen_string_literal: true RSpec.describe Protos::Modal::CloseButton do subject { page } before do render described_class.new { "Close" } end it { is_expected.to have_css("form[method='dialog']") } it { is_expected.to have_button } it { is_expected.to have_content("Close") } it { is_expected.to ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/trigger_spec.rb
Ruby
mit
91
master
363
# frozen_string_literal: true RSpec.describe Protos::Command::Trigger do before do render described_class.new { "Trigger" } end it "renders the trigger" do expect(page).to have_button expect(page).to have_content("Trigger") end it "adds the stimulus action" do expect(page).to have_css("[dat...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/group_spec.rb
Ruby
mit
91
master
331
# frozen_string_literal: true RSpec.describe Protos::Command::Group do before do render described_class.new { "Item" } end it "renders the item" do expect(page).to have_content("Item") end it "renders the default attributes" do expect(page).to have_css("li[data-protos--command-target='group']")...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/title_spec.rb
Ruby
mit
91
master
360
# frozen_string_literal: true RSpec.describe Protos::Command::Title do subject { page } before do render described_class.new { "Title" } end context "content" do it { is_expected.to have_css("li > h2") } it { is_expected.to have_content("Title") } end context "styles" do it { is_expected...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/list_spec.rb
Ruby
mit
91
master
394
# frozen_string_literal: true RSpec.describe Protos::Command::List do before do render described_class.new end it "renders the list" do expect(page).to have_css("ul") end it "adds the styles" do expect(page).to have_css(".menu") end it "connects the stimulus controller for command" do ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/empty_spec.rb
Ruby
mit
91
master
382
# frozen_string_literal: true RSpec.describe Protos::Command::Empty do before do render described_class.new end it "renders the empty" do expect(page).to have_css("li") end it "renders as hidden" do expect(page).to have_css(".hidden") end it "adds the stimulus target" do expect(page).t...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/item_spec.rb
Ruby
mit
91
master
491
# frozen_string_literal: true RSpec.describe Protos::Command::Item do before do render described_class.new { "Item" } end it "renders the item" do expect(page).to have_css("li", text: "Item") end it "adds the stimulus target" do expect(page).to have_stimulus_target("protos--command", "item") ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/command/input_spec.rb
Ruby
mit
91
master
517
# frozen_string_literal: true RSpec.describe Protos::Command::Input do subject { page } before do render described_class.new { "X" } end context "content" do it { is_expected.to have_css("li") } it { is_expected.to have_field(type: :text) } it { is_expected.to have_content("X") } end con...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/list/item_spec.rb
Ruby
mit
91
master
449
# frozen_string_literal: true RSpec.describe Protos::List::Item do before do render described_class.new(grow: true, wrap: true) { "content" } end it "renders the list item" do expect(page).to have_css("li") expect(page).to have_content("content") end it "renders the styles" do expect(page)....
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/toast/close_button_spec.rb
Ruby
mit
91
master
438
# frozen_string_literal: true RSpec.describe Protos::Toast::CloseButton do subject { page } before do render described_class.new { "Close" } end context "content" do it { is_expected.to have_content("Close") } it { is_expected.to have_button } end context "accessibility" do it { is_expec...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/typography/heading_spec.rb
Ruby
mit
91
master
435
# frozen_string_literal: true RSpec.describe Protos::Typography::Heading do before do render described_class.new end it "renders the heading" do expect(page).to have_css("h1") expect(page).to have_css(".text-2xl") expect(page).to have_css(".font-semibold") expect(page).to have_css(".scroll-m...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/typography/paragraph_spec.rb
Ruby
mit
91
master
254
# frozen_string_literal: true RSpec.describe Protos::Typography::Paragraph do before do render described_class.new end it "renders the paragraph" do expect(page).to have_css("p") expect(page).to have_css(".leading-relaxed") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/typography/inline_link_spec.rb
Ruby
mit
91
master
450
# frozen_string_literal: true RSpec.describe Protos::Typography::InlineLink do before do render described_class.new { "Click me" } end it "renders the inline link" do expect(page).to have_css("a") expect(page).to have_content("Click me") end it "renders the style" do expect(page).to have_cs...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/swap/on_spec.rb
Ruby
mit
91
master
326
# frozen_string_literal: true RSpec.describe Protos::Swap::On do before do render described_class.new { "swap on" } end it "renders the swap on" do expect(page).to have_css("div") expect(page).to have_content("swap on") end it "renders the style" do expect(page).to have_css(".swap-on") en...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/swap/off_spec.rb
Ruby
mit
91
master
331
# frozen_string_literal: true RSpec.describe Protos::Swap::Off do before do render described_class.new { "swap off" } end it "renders the swap off" do expect(page).to have_css("div") expect(page).to have_content("swap off") end it "renders the style" do expect(page).to have_css(".swap-off")...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/body_spec.rb
Ruby
mit
91
master
246
# frozen_string_literal: true RSpec.describe Protos::Table::Body do before do render described_class.new { "body" } end it "renders a footer" do expect(page).to have_css("tbody") expect(page).to have_content("body") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/row_spec.rb
Ruby
mit
91
master
393
# frozen_string_literal: true RSpec.describe Protos::Table::Row do before do render described_class.new { "row" } end it "renders the row" do expect(page).to have_css("tr") expect(page).to have_content("row") end it "renders the styles" do expect(page).to have_css(".print\\:break-inside-avo...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/head_spec.rb
Ruby
mit
91
master
328
# frozen_string_literal: true RSpec.describe Protos::Table::Head do before do render described_class.new { "head" } end it "renders a table heading" do expect(page).to have_css("th") expect(page).to have_content("head") end it "renders the style" do expect(page).to have_css(".text-left") ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/footer_spec.rb
Ruby
mit
91
master
340
# frozen_string_literal: true RSpec.describe Protos::Table::Footer do before do render described_class.new { "Footer" } end it "renders a footer" do expect(page).to have_css("tfoot") expect(page).to have_content("Footer") end it "renders the styles" do expect(page).to have_css(".table-foote...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/cell_spec.rb
Ruby
mit
91
master
321
# frozen_string_literal: true RSpec.describe Protos::Table::Cell do before do render described_class.new { "cell" } end it "renders the cell" do expect(page).to have_css("td") expect(page).to have_content("cell") end it "renders the style" do expect(page).to have_css(".text-left") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/header_spec.rb
Ruby
mit
91
master
340
# frozen_string_literal: true RSpec.describe Protos::Table::Header do before do render described_class.new { "header" } end it "renders a header" do expect(page).to have_css("thead") expect(page).to have_content("header") end it "renders the styles" do expect(page).to have_css(".table-heade...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/table/caption_spec.rb
Ruby
mit
91
master
341
# frozen_string_literal: true RSpec.describe Protos::Table::Caption do before do render described_class.new { "Caption" } end it "renders a caption" do expect(page).to have_css("caption") expect(page).to have_content("Caption") end it "renders the style" do expect(page).to have_css(".captio...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/collapse/title_spec.rb
Ruby
mit
91
master
677
# frozen_string_literal: true RSpec.describe Protos::Collapse::Title do context "with an input id" do before do render described_class.new(input_id: 1) { "Title" } end it "renders the title as a label" do expect(page).to have_css(".collapse-title") expect(page).to have_content("Title")...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/collapse/content_spec.rb
Ruby
mit
91
master
271
# frozen_string_literal: true RSpec.describe Protos::Collapse::Content do before do render described_class.new { "Content" } end it "renders the title" do expect(page).to have_css(".collapse-content") expect(page).to have_content("Content") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/chat_bubble/image_spec.rb
Ruby
mit
91
master
361
# frozen_string_literal: true RSpec.describe Protos::ChatBubble::Image do before do render described_class.new { "Chat image content" } end it "renders a chat image" do expect(page).to have_css("div") expect(page).to have_content("Chat image content") end it "renders the style" do expect(pa...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/chat_bubble/content_spec.rb
Ruby
mit
91
master
444
# frozen_string_literal: true RSpec.describe Protos::ChatBubble::Content do before do render described_class.new(type: :primary) { "Chat bubble content" } end it "renders a chat bubble content" do expect(page).to have_css("div") expect(page).to have_content("Chat bubble content") end it "render...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/chat_bubble/header_spec.rb
Ruby
mit
91
master
366
# frozen_string_literal: true RSpec.describe Protos::ChatBubble::Header do before do render described_class.new { "Chat header content" } end it "renders a chat header" do expect(page).to have_css("div") expect(page).to have_content("Chat header content") end it "renders the style" do expec...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/chat_bubble/footer_spec.rb
Ruby
mit
91
master
366
# frozen_string_literal: true RSpec.describe Protos::ChatBubble::Footer do before do render described_class.new { "Chat footer content" } end it "renders a chat footer" do expect(page).to have_css("div") expect(page).to have_content("Chat footer content") end it "renders the style" do expec...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/diff/item_spec.rb
Ruby
mit
91
master
418
# frozen_string_literal: true RSpec.describe Protos::Diff::Item do subject { page } before do render described_class.new(order: :one) { "Content" } end context "content" do it { is_expected.to have_content("Content") } end context "accessibility" do it { is_expected.to have_css("div[role='im...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/diff/resizer_spec.rb
Ruby
mit
91
master
361
# frozen_string_literal: true RSpec.describe Protos::Diff::Resizer do subject { page } before do render described_class.new { "Content" } end context "content" do it { is_expected.to have_content("Content") } it { is_expected.to have_css("div") } end context "styles" do it { is_expected....
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/accordion/item_spec.rb
Ruby
mit
91
master
939
# frozen_string_literal: true RSpec.describe Protos::Accordion::Item do subject { page } before do render described_class.new(input_name: "some-id") { "Content 1" } end it { is_expected.to have_content "Content 1" } it { is_expected.to have_css ".collapse" } it { is_expected.to have_field("some-id") ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/breadcrumbs/crumb_spec.rb
Ruby
mit
91
master
273
# frozen_string_literal: true RSpec.describe Protos::Breadcrumbs::Crumb do before do render described_class.new { "Crumb content" } end it "renders the component" do expect(page).to have_css("li") expect(page).to have_content("Crumb content") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/timeline/right_spec.rb
Ruby
mit
91
master
336
# frozen_string_literal: true RSpec.describe Protos::Timeline::Right do before do render described_class.new { "content" } end it "renders the right" do expect(page).to have_css("div") expect(page).to have_content("content") end it "renders the style" do expect(page).to have_css(".timeline-...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/timeline/left_spec.rb
Ruby
mit
91
master
336
# frozen_string_literal: true RSpec.describe Protos::Timeline::Left do before do render described_class.new { "content" } end it "renders the left" do expect(page).to have_css("div") expect(page).to have_content("content") end it "renders the style" do expect(page).to have_css(".timeline-st...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/timeline/item_spec.rb
Ruby
mit
91
master
252
# frozen_string_literal: true RSpec.describe Protos::Timeline::Item do before do render described_class.new { "content" } end it "renders the item" do expect(page).to have_css("li") expect(page).to have_content("content") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/timeline/center_spec.rb
Ruby
mit
91
master
341
# frozen_string_literal: true RSpec.describe Protos::Timeline::Center do before do render described_class.new { "content" } end it "renders the center" do expect(page).to have_css("div") expect(page).to have_content("content") end it "renders the style" do expect(page).to have_css(".timelin...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/card/title_spec.rb
Ruby
mit
91
master
255
# frozen_string_literal: true RSpec.describe Protos::Card::Title do before do render described_class.new { "Title" } end it "renders the title" do expect(page).to have_css(".card-title") expect(page).to have_content("Title") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/card/image_spec.rb
Ruby
mit
91
master
252
# frozen_string_literal: true RSpec.describe Protos::Card::Image do before do render described_class.new { "image" } end it "renders the actions" do expect(page).to have_css("figure") expect(page).to have_content("image") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/card/actions_spec.rb
Ruby
mit
91
master
265
# frozen_string_literal: true RSpec.describe Protos::Card::Actions do before do render described_class.new { "Actions" } end it "renders the actions" do expect(page).to have_css(".card-actions") expect(page).to have_content("Actions") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/card/body_spec.rb
Ruby
mit
91
master
327
# frozen_string_literal: true RSpec.describe Protos::Card::Body do before do render described_class.new { "Content" } end it "renders the body" do expect(page).to have_css("div") expect(page).to have_content("Content") end it "renders the style" do expect(page).to have_css(".card-body") e...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/popover/trigger_spec.rb
Ruby
mit
91
master
571
# frozen_string_literal: true RSpec.describe Protos::Popover::Trigger do subject { page } before do render described_class.new { "Some trigger" } end context "content" do it { is_expected.to have_css("button") } it { is_expected.to have_content("Some trigger") } end context "interactivity" d...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/popover/content_spec.rb
Ruby
mit
91
master
265
# frozen_string_literal: true RSpec.describe Protos::Popover::Content do before do render described_class.new(as_template: false) { "Some content" } end it "renders the popover content" do expect(page).to have_css("div", visible: :hidden) end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/alert/icon_spec.rb
Ruby
mit
91
master
246
# frozen_string_literal: true RSpec.describe Protos::Alert::Icon do before do render described_class.new { "icon" } end it "renders the action" do expect(page).to have_css("div") expect(page).to have_content("icon") end end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/alert/actions_spec.rb
Ruby
mit
91
master
309
# frozen_string_literal: true RSpec.describe Protos::Alert::Actions do subject { page } before do render described_class.new { "Action" } end it { is_expected.to have_css("nav") } it { is_expected.to have_content("Action") } it { is_expected.to have_css("[aria-label=alert-actions]") } end
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/drawer/trigger_spec.rb
Ruby
mit
91
master
436
# frozen_string_literal: true RSpec.describe Protos::Drawer::Trigger do subject { page } before do render described_class.new(input_id: "some_id") { "trigger" } end context "content" do it { is_expected.to have_content("trigger") } end context "accessibility" do it { is_expected.to have_css(...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/drawer/content_spec.rb
Ruby
mit
91
master
345
# frozen_string_literal: true RSpec.describe Protos::Drawer::Content do before do render described_class.new { "drawer" } end it "renders the drawer sidebar" do expect(page).to have_css("div") expect(page).to have_content("drawer") end it "renders the style" do expect(page).to have_css(".dr...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/drawer/side_spec.rb
Ruby
mit
91
master
527
# frozen_string_literal: true RSpec.describe Protos::Drawer::Side do subject { page } before do render described_class.new(input_id: "some_id") { "drawer" } end context "content" do it { is_expected.to have_css("aside") } it { is_expected.to have_content("drawer") } end context "accessibilit...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/tabs/tab_spec.rb
Ruby
mit
91
master
634
# frozen_string_literal: true RSpec.describe Protos::Tabs::Tab do subject { page } before do render described_class.new( disabled: true, active: true, href: "/somewhere" ) { "Tab content" } end context "content" do it { is_expected.to have_content("Tab content") } it { is_ex...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/stats/actions_spec.rb
Ruby
mit
91
master
353
# frozen_string_literal: true RSpec.describe Protos::Stats::Actions do before do render described_class.new { "Action content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Action content") end it "renders the style" do expect(page).to hav...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/stats/description_spec.rb
Ruby
mit
91
master
364
# frozen_string_literal: true RSpec.describe Protos::Stats::Description do before do render described_class.new { "Description content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Description content") end it "renders the style" do expec...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/stats/figure_spec.rb
Ruby
mit
91
master
351
# frozen_string_literal: true RSpec.describe Protos::Stats::Figure do before do render described_class.new { "Figure content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Figure content") end it "renders the style" do expect(page).to have...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/stats/stat_spec.rb
Ruby
mit
91
master
338
# frozen_string_literal: true RSpec.describe Protos::Stats::Stat do before do render described_class.new { "Stat content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Stat content") end it "renders the style" do expect(page).to have_css("...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/stats/value_spec.rb
Ruby
mit
91
master
347
# frozen_string_literal: true RSpec.describe Protos::Stats::Value do before do render described_class.new { "Value content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Value content") end it "renders the style" do expect(page).to have_cs...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/stats/title_spec.rb
Ruby
mit
91
master
347
# frozen_string_literal: true RSpec.describe Protos::Stats::Title do before do render described_class.new { "Title content" } end it "renders the component" do expect(page).to have_css("div") expect(page).to have_content("Title content") end it "renders the style" do expect(page).to have_cs...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/steps/step_spec.rb
Ruby
mit
91
master
357
# frozen_string_literal: true RSpec.describe Protos::Steps::Step do subject do described_class.new(type: :info) { "Step 1" } end before { render subject } it "renders the step" do expect(page).to have_css("li") expect(page).to have_content("Step 1") end it "renders the styles" do expect(...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/carousel/item_spec.rb
Ruby
mit
91
master
370
# frozen_string_literal: true RSpec.describe Protos::Carousel::Item do before do render described_class.new { "Carousel item content" } end it "renders a carousel item" do expect(page).to have_css("div") expect(page).to have_content("Carousel item content") end it "renders the style" do exp...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
spec/protos/carousel/actions_spec.rb
Ruby
mit
91
master
362
# frozen_string_literal: true RSpec.describe Protos::Carousel::Actions do before do render described_class.new { "Action content" } end it "renders a carousel item actions" do expect(page).to have_css("div") expect(page).to have_content("Action content") end it "renders the style" do expect...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
examples/list.rb
Ruby
mit
91
master
494
# frozen_string_literal: true require "protos" class List < Protos::Component def view_template ul(**attrs) do li(class: css[:item]) { "Item 1" } li(class: css[:item]) { "Item 2" } end end def default_attrs { data: { controller: "list" } } end def theme ...
github
inhouse-work/protos
https://github.com/inhouse-work/protos
examples/navbar.rb
Ruby
mit
91
master
800
# frozen_string_literal: true require_relative "../lib/protos" class Navbar < Protos::Component def view_template header(**attrs) do h1(class: css[:heading]) { "Hello world" } h2(class: css[:subtitle]) { "With a subtitle" } end end private def default_attrs { data: { controller...
github
jhawthorn/sheap
https://github.com/jhawthorn/sheap
sheap.gemspec
Ruby
mit
90
main
1,139
# frozen_string_literal: true require_relative "lib/sheap/version" Gem::Specification.new do |spec| spec.name = "sheap" spec.version = Sheap::VERSION spec.authors = ["John Hawthorn"] spec.email = ["john@hawthorn.email"] spec.summary = "A helpers for heap dumps" spec.description = "A set of helpers for an...
github
jhawthorn/sheap
https://github.com/jhawthorn/sheap
lib/sheap.rb
Ruby
mit
90
main
10,801
# frozen_string_literal: true require "objspace" require "fileutils" require "json" class Sheap def self.reload! load __FILE__ end def initialize @dir = File.expand_path("sheap") @idx = 0 FileUtils.mkdir_p(@dir) end module Collection def class_named(name) filter do |obj| ...
github
jhawthorn/sheap
https://github.com/jhawthorn/sheap
test/test_sheap.rb
Ruby
mit
90
main
2,564
# frozen_string_literal: true require "test_helper" class TestSheap < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Sheap::VERSION end def test_diff run_ruby(<<~RUBY) require "objspace" GC.start $arr = [] ObjectSpace.dump_all(output: open("tmp/snapshot1.dump"...
github
dougal/base58
https://github.com/dougal/base58
Rakefile
Ruby
mit
90
master
1,087
require 'rake' require 'rake/testtask' require 'rdoc/task' desc 'Default: run unit tests.' task :default => :test desc 'Test the base58 library.' Rake::TestTask.new do |t| t.libs << 'lib' t.pattern = 'test/**/test_*.rb' t.verbose = false end desc 'Generate RDoc documentation.' Rake::RDocTask.new do |rdoc| rd...
github
dougal/base58
https://github.com/dougal/base58
base58.gemspec
Ruby
mit
90
master
1,064
# Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- # stub: base58 0.2.3 ruby lib Gem::Specification.new do |s| s.name = "base58".freeze s.version = "0.2.3" s.required_rubygems_version = Gem::Requirement.new(">= 0"....
github
dougal/base58
https://github.com/dougal/base58
test/test_base58.rb
Ruby
mit
90
master
28,148
require 'test/unit' require 'base58' class TestBase58 < Test::Unit::TestCase EXAMPLES = { :flickr => { "6hKMCS" => 3471391110, "6hDrmR" => 3470152229, "6hHHZB" => 3470988633, "6hHKum" => 3470993664, "6hLgFW" => 3471485480, "6hBRKR"...
github
dougal/base58
https://github.com/dougal/base58
lib/base58.rb
Ruby
mit
90
master
3,322
# Base58 # Copyright (c) 2009 - 2018 Douglas F Shearer. # http://douglasfshearer.com # Distributed under the MIT license as included with this plugin. class Base58 # See https://en.wikipedia.org/wiki/Base58 ALPHABETS = { flickr: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ", # This is the defa...
github
aarongough/flea
https://github.com/aarongough/flea
flea.gemspec
Ruby
mit
90
master
1,189
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'flea/version' Gem::Specification.new do |spec| spec.name = 'flea' spec.version = Flea::VERSION spec.authors = ['Aaron Gough'] spec.email = ['aaron@...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/interpreter_spec.rb
Ruby
mit
90
master
2,017
# frozen_string_literal: true require 'spec_helper' describe Flea::Interpreter do describe '.new' do it 'returns an Interpreter' do expect(Flea::Interpreter.new).to be_a Flea::Interpreter end it 'allows setting the base environment' do environment = double(:environment) interpreter = ...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/environment_spec.rb
Ruby
mit
90
master
3,272
# frozen_string_literal: true require 'spec_helper' describe Flea::Environment do describe '.new' do let(:environment) { Flea::Environment.new } it 'returns an environment object' do expect(environment).to be_an Flea::Environment end it 'returns an environment object with no parent' do ...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/standard_library/greater_than_spec.rb
Ruby
mit
90
master
737
# frozen_string_literal: true require 'spec_helper' describe 'Standard Library' do describe 'greater-than?' do let(:interpreter) { Flea::Interpreter.new } it "return true if it's first argument is larger than all the others" do result = interpreter.run('(greater-than? 10 1 2 3 4)') expect(resul...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/standard_library/append_spec.rb
Ruby
mit
90
master
345
# frozen_string_literal: true require 'spec_helper' describe 'Standard Library' do describe 'append' do let(:interpreter) { Flea::Interpreter.new } it 'union of two lists' do result = interpreter.run(' (append (quote (1 2 3)) (quote (1 2 3))) ') expect(result).to eq([1, 2, 3, 1, ...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/standard_library/begin_spec.rb
Ruby
mit
90
master
467
# frozen_string_literal: true require 'spec_helper' describe 'Standard Library' do describe 'begin' do let(:interpreter) { Flea::Interpreter.new } it 'should execute each expression after the begin call and return final value' do result = interpreter.run(' (begin (define test 1) ...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/standard_library/list_tail_spec.rb
Ruby
mit
90
master
351
# frozen_string_literal: true require 'spec_helper' describe 'Standard Library' do describe 'list-tail' do let(:interpreter) { Flea::Interpreter.new } it 'should return trailing subset of list' do result = interpreter.run(' (list-tail (quote (1 2 3 4 5)) 2) ') expect(result).to e...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/standard_library/cons_spec.rb
Ruby
mit
90
master
705
# frozen_string_literal: true require 'spec_helper' describe 'Standard Library' do describe 'cons' do before :each do @interpreter = Flea::Interpreter.new end it 'should create a list from an atom and an empty list' do result = @interpreter.run("(cons (quote a) (quote ()))") expect(re...
github
aarongough/flea
https://github.com/aarongough/flea
spec/flea/standard_library/null_spec.rb
Ruby
mit
90
master
554
# frozen_string_literal: true require 'spec_helper' describe 'Standard Library' do describe 'null?' do let(:interpreter) { Flea::Interpreter.new } it 'should return true for an empty list' do result = interpreter.run(' (null? (quote ())) ') expect(result).to be true end ...