New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rspec_method_grouping

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rspec_method_grouping

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RSpecMethodGrouping

This gem manages supporting methods that are used in rspec example.

Installation

gem 'rspec_method_grouping'

Usage

before

In defining methods, we need long different names. They are not readable.

def registration_page_submit_button
  find('button', text: 'Register Now!')
end

def mail_page_submit_button
  find('button', text: 'Send Now!')
end

describe 'registration' do
  it do
    visit '/resistration'
    
    # input data to some form
    
    registration_page_submit_button.click

    visit '/contact'
    
    # input data to some form
    
    mail_page_submit_button.click
  end
end

After

In defining methods, we need some steps. But, They are readable and easy to detect names.

class RegistrationPage < RSpecMethodGrouping::Base
  def submit_button
   find('button', text: 'Register Now!')
  end
end

class ContactPage < RSpecMethodGrouping::Base
  def submit_button
   find('button', text: 'Send Now!')
  end
end

describe 'registration' do
  it do
    visit '/resistration'
    
    # input data to some form
    
    RegistrationPage.submit_button.click
    
    visit '/contact'
    
    # input data to some form
    
    ContactPage.submit_button.click
  end
end

FAQs

Package last updated on 23 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc