{"id":47847,"date":"2021-08-01T08:08:09","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"https:\/\/www.sejuku.net\/blog\/?p=47847"},"modified":"2024-05-06T11:46:26","modified_gmt":"2024-05-06T02:46:26","slug":"%e3%80%90rails%e5%85%a5%e9%96%80%e3%80%91rspec%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%9f%e3%83%86%e3%82%b9%e3%83%88%e6%96%b9%e6%b3%95%e3%82%92%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%ab%e5%9f%ba","status":"publish","type":"post","link":"https:\/\/www.sejuku.net\/blog\/47847","title":{"rendered":"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30aa\u30aa\u30a4\u30b7\u3067\u3059\u3002<\/p>\n<p><span style=\"color: #339966\"><strong>RSpec(\u30a2\u30fc\u30eb\u30b9\u30da\u30c3\u30af)<\/strong><\/span>\u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>RSpec\u306f\u3001Ruby\u3084Ruby on Rails\u306e\u4ee3\u8868\u7684\u306a\u30c6\u30b9\u30c8\u30c4\u30fc\u30eb\u306e\u3053\u3068\u3067\u3001<span style=\"color: #0000ff\"><strong>\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u5358\u4f4d\u3067\u30c6\u30b9\u30c8<\/strong><\/span>\u3059\u308b\u305f\u3081\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u624b\u6cd5\u3092\u899a\u3048\u3066\u304a\u304f\u3068\u3001<span style=\"color: #0000ff\"><strong>\u30b3\u30de\u30f3\u30c91\u3064\u3067\u4f55\u5ea6\u3067\u3082\u30c6\u30b9\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b<\/strong><\/span>\u306e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d0\u30b0\u3092\u6e1b\u3089\u3057\u305f\u308a\u3001\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff01<\/p>\n<p>\u305d\u3093\u306aRSpec\u306f<span style=\"color: #ff0000\"><strong>\u306a\u3093\u3060\u304b\u96e3\u3057\u305d\u3046\u3060<\/strong><\/span>\u3068\u611f\u3058\u305f\u4eba\u306e\u305f\u3081\u306b\u3001\u4eca\u56de\u306f\u3001<\/p>\n<ul>\n<li><span style=\"color: #ff0000\"><strong>RSpec\u3068\u306f<\/strong><\/span><\/li>\n<li><span style=\"color: #ff0000\"><strong>RSpec\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/strong><\/span><\/li>\n<li><span style=\"color: #ff0000\"><strong>Ruby on Rails \u3092\u30c6\u30b9\u30c8\u3057\u3066\u307f\u3088\u3046<\/strong><\/span><\/li>\n<\/ul>\n<p>\u3068\u3044\u3063\u305f\u3001\u57fa\u672c\u7684\u306a\u89e3\u8aac\u304b\u3089\u3001<\/p>\n<ul>\n<li><span style=\"color: #ff0000\"><strong>\u7279\u306b\u91cd\u8981\u306a\u69cb\u6587\u306e\u4f7f\u3044\u65b9<\/strong><\/span><\/li>\n<\/ul>\n<p>\u306a\u3069\u306e\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u306b\u95a2\u3057\u3066\u3082\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fRspec\u306e\u57fa\u790e\u3092\u7406\u89e3\u3057\u3066\u3044\u305f\u3060\u304f\u305f\u3081\u306b\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3057\u307e\u3059\uff01<\/p>\n<h2>RSpec\u3068\u306f<\/h2>\n<p><span style=\"color: #339966\"><strong>RSpec<\/strong><\/span>\u3068\u306f\u3001Ruby\u3084Ruby on Rails\u3067\u4f5c\u3063\u305f\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u3092\u30c6\u30b9\u30c8\u3059\u308b\u305f\u3081\u306e\u30c9\u30e1\u30a4\u30f3\u7279\u5316\u8a00\u8a9e (DSL)\u3092\u4f7f\u3063\u305f\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u306f\u3001<span style=\"color: #0000ff\"><strong>\u30c6\u30b9\u30c8\u5c02\u7528\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u8a00\u8a9e<\/strong><\/span>\u3068\u3082\u8a00\u3048\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000\"><strong>\u300c\u5225\u306e\u8a00\u8a9e\u3092\u307e\u305f\u899a\u3048\u308b\u306f\u30c4\u30e9\u30a4\u30fb\u30fb\u30fb\u300d<\/strong><\/span><\/p>\n<p>\u3068\u3001\u611f\u3058\u305f\u304b\u3082\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u30d9\u30fc\u30b9\u306fRuby\u304b\u3089\u4f5c\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001<span style=\"color: #ff0000;background-color: #ffff99\"><strong>\u672c\u8a18\u4e8b\u3092\u8aad\u3093\u3067\u3044\u305f\u3060\u3051\u308c\u3070\u3001\u7c21\u5358\u306b\u59cb\u3081\u3089\u308c\u307e\u3059\uff01<\/strong><\/span><\/p>\n<h3>RSpec\u306e\u7279\u5fb4<\/h3>\n<p>RSpec\u306b\u306f\u30c6\u30b9\u30c8\u306e<span style=\"color: #0000ff\"><strong>\u30b5\u30dd\u30fc\u30c8\u6a5f\u80fd<\/strong><\/span>\u304c\u3044\u308d\u3044\u308d\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001<\/p>\n<ul>\n<li><span style=\"color: #339966\"><strong>Ruby on Rails<\/strong><\/span>\u306e\u30c6\u30b9\u30c8\u30b5\u30dd\u30fc\u30c8<\/li>\n<li>\u30e2\u30c3\u30af\u3084\u30b9\u30bf\u30d6(\u64ec\u4f3c\u7684\u306a\u30af\u30e9\u30b9)\u306b\u3088\u308b\u30c6\u30b9\u30c8\u652f\u63f4<\/li>\n<li>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u4f5c\u6210\u652f\u63f4<\/li>\n<li><span style=\"color: #339966\"><strong>\u30ab\u30d0\u30ec\u30c3\u30b8\u30c4\u30fc\u30eb<\/strong><\/span>\u3068\u306e\u9023\u643a(\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u3055\u308c\u305f\u5272\u5408\u3092\u78ba\u8a8d\u3059\u308b\u30c4\u30fc\u30eb)<\/li>\n<li>\u30c6\u30b9\u30c8\u7d50\u679c\u306eHTML\u51fa\u529b\u6a5f\u80fd<\/li>\n<\/ul>\n<p>\u306a\u3069\u3001RSpec\u306e\u30b3\u30de\u30f3\u30c9\u4e00\u3064\u3067\u3044\u308d\u3044\u308d\u306a\u6a5f\u80fd\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306bRSpec\u306f\u8c4a\u5bcc\u306a\u6a5f\u80fd\u3092\u5099\u3048\u3066\u3044\u307e\u3059\u304c\u3001<span style=\"color: #0000ff\"><strong>\u30c6\u30b9\u30c8\u306e\u5b9f\u65bd\u65b9\u6cd5\u306e\u539f\u5247<\/strong><\/span>\u306b\u5909\u308f\u308a\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b21\u306e\u9805\u3067\u306f\u3001\u30c6\u30b9\u30c8\u306e\u9032\u3081\u65b9\u306e\u57fa\u672c\u306b\u3064\u3044\u3066\u89e3\u8aac\u3044\u305f\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30c6\u30b9\u30c8\u306e\u9032\u3081\u65b9\u306e\u57fa\u672c<\/h3>\n<p>\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u5358\u4f4d\u306e\u30c6\u30b9\u30c8\u306e\u3053\u3068\u3092<span style=\"color: #339966\"><strong>\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8<\/strong><\/span>\u3068\u8a00\u3063\u305f\u308a\u3057\u307e\u3059\u304c\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>RSpec\u306b\u9650\u3089\u305a\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u306e\u9032\u3081\u65b9\u306b\u306f<span style=\"color: #339966\"><strong>\u539f\u5247<\/strong><\/span>\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092<span style=\"color: #0000ff\"><strong>\u66f8\u304f\u524d<\/strong><\/span>\u306b<span style=\"color: #0000ff\"><strong>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304f<\/strong><\/span><\/li>\n<li>\u30c6\u30b9\u30c8\u5b9f\u884c\u3057\u3066\u5931\u6557\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b<\/li>\n<li>\u30c6\u30b9\u30c8\u304c\u6210\u529f\u3059\u308b\u3088\u3046\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f<\/li>\n<li>\u521d\u3081\u306b\u623b\u308b<\/li>\n<\/ol>\n<p>\u3092\u7e70\u308a\u8fd4\u3057\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3059\u308b\u524d\u306b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u3092\u3001<span style=\"color: #339966\"><strong>\u30c6\u30b9\u30c8\u30d5\u30a1\u30fc\u30b9\u30c8<\/strong><\/span>\u3068\u8a00\u3044\u307e\u3059\u3002<\/p>\n<p>\u958b\u767a\u624b\u6cd5\u3067\u3044\u3048\u3070<span style=\"color: #339966\"><strong>TDD(\u30c6\u30b9\u30c8\u99c6\u52d5\u958b\u767a)<\/strong><\/span>\u3068\u304b\u3001<span style=\"color: #339966\"><strong>BDD(\u632f\u308b\u821e\u3044\u99c6\u52d5\u958b\u767a)<\/strong><\/span>\u306b\u5206\u985e\u3055\u308c\u308b\u958b\u767a\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f<span style=\"color: #0000ff\"><strong>\u300c\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3068\u30d7\u30ed\u30b0\u30e9\u30e0\u30b3\u30fc\u30c9\u3092\u540c\u6642\u306b\u66f8\u304f\u300d<\/strong><\/span>\u3053\u3068\u3092\u610f\u8b58\u3044\u305f\u3060\u3051\u308c\u3070\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3067\u306f\u3001\u6b21\u7ae0\u304b\u3089Rspec\u306e\u4f7f\u3044\u65b9\u3092\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\uff01<\/p>\n<h2>RSpec\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n<p>\u306f\u3058\u3081\u306b\u3001Ruby on Rails\u306e<span style=\"color: #339966\"><strong>Bundler<\/strong><\/span>\u3092\u4f7f\u3063\u3066RSpec\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3053\u308d\u304b\u3089\u59cb\u3081\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u3001Rspec\u306e\u5b9f\u884c\u65b9\u6cd5\u3068\u57fa\u672c\u7684\u306a\u69cb\u6587\u3092\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001Ruby on Rails \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u3061\u3089\u3067\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/39936\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/12\/ruby_on_rails-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u521d\u5fc3\u8005\u3067\u3082\u304b\u3093\u305f\u3093\uff01Ruby on Rails \u306e\u958b\u767a\u74b0\u5883\u306e\u69cb\u7bc9\u624b\u9806\uff08Mac\/Windows \u4e21\u5bfe\u5fdc\uff09<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<h3>Gemfile\u306b\u8ffd\u52a0<\/h3>\n<p>Ruby on Rails \u306bRSpec\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u305f\u3081\u306b\u306f<span style=\"color: #339966\"><strong>Bundler<\/strong><\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>Gemfile\u3092\u958b\u3044\u3066\u6b21\u306e\u3088\u3046\u306b<span style=\"color: #0000ff\"><strong>\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/span><\/p>\n<pre class=\"lang:ruby decode:true \">group :development, :test do\r\n  # \u301c \u7701\u7565 \u301c\r\n  gem 'rspec-rails'\r\nend<\/pre>\n<p>bundle\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">bundle install<\/pre>\n<p>\u7d9a\u3044\u3066\u3001Ruby on Rails\u3067Rspec\u3092\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u521d\u671f\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002<\/p>\n<h3>RSpec\u306e\u521d\u671f\u8a2d\u5b9a<\/h3>\n<p>Ruby on Rails\u3067Rspec\u3092\u4f7f\u3046\u305f\u3081\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066<span style=\"color: #0000ff\"><strong>\u521d\u671f\u8a2d\u5b9a\u3059\u308b<\/strong><\/span>\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">bin\/rails generate rspec:install<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true\">Running via Spring preloader in process 17316\r\n create  .rspec                 # \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\r\n create  spec                   # \u30b9\u30da\u30c3\u30af\u30d5\u30a1\u30a4\u30eb\u3092\u683c\u7d0d\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\r\n create  spec\/spec_helper.rb    # RSpec\u306e\u30d8\u30eb\u30d1(\u30e1\u30bd\u30c3\u30c9\u7fa4)    \r\n create  spec\/rails_helper.rb   # Rails\u7528\u306eRSpec\u306e\u30d8\u30eb\u30d1(\u30e1\u30bd\u30c3\u30c9\u7fa4)<\/pre>\n<p>\u3053\u308c\u3067\u3001RSpec\u3092\u4f7f\u3046\u305f\u3081\u306e\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h3>\u30b9\u30da\u30c3\u30af\u306e\u914d\u7f6e\u30eb\u30fc\u30eb\u3068\u547d\u540d\u898f\u5247<\/h3>\n<p>RSpec\u3067\u306f\u3001\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u3053\u3068\u3092<span style=\"color: #339966\"><strong>\u30b9\u30da\u30c3\u30af(\u4ed5\u69d8)<\/strong><\/span>\u3068\u8a00\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u306f\u3001<span style=\"color: #0000ff\"><strong>\u4ed5\u69d8(\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u632f\u308b\u821e\u3044)\u3092\u66f8\u304f\u3053\u3068\u3068\u540c\u3058<\/strong><\/span>\u3068\u8003\u3048\u308b\u3068\u7406\u89e3\u3057\u3084\u3059\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30b9\u30da\u30c3\u30af\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306b\u306f<span style=\"color: #ff0000\"><strong>\u30d5\u30a1\u30a4\u30eb\u306e\u914d\u7f6e\u30eb\u30fc\u30eb\u3068\u547d\u540d\u898f\u5247<\/strong><\/span>\u306b\u5f93\u308f\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>Ruby on Rails\u306e\u5834\u5408\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\"> spec\/\r\n   models\/\r\n      \u30e2\u30c7\u30eb\u30d5\u30a1\u30a4\u30eb\u540d_spec.rb\r\n   controllers\/  \r\n      \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30d5\u30a1\u30a4\u30eb\u540d_spec.rb\r\n   views\/\r\n      erb\u30d5\u30a1\u30a4\u30eb\u540d_spec.rb<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<span style=\"color: #0000ff\"><strong>Ruby on Rails\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u3068\u540c\u3058\u968e\u5c64\u69cb\u6210<\/strong><\/span>\u3067spec\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<p>RSpec\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u304c\u5b8c\u4e86\u3057\u305f\u306e\u3067\u3001\u6b21\u306f\u30c6\u30b9\u30c8\u65b9\u6cd5\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\uff01<\/p>\n<h2>Ruby on Rails \u3092\u30c6\u30b9\u30c8\u3057\u3066\u307f\u3088\u3046<\/h2>\n<h3>\u30c6\u30b9\u30c8\u6e96\u5099<\/h3>\n<p>\u307e\u305a\u306f\u3058\u3081\u306b\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u3068\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306e\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001<span style=\"color: #339966\"><strong>\u59d3(last_name)<\/strong><\/span>\u3068<span style=\"color: #339966\"><strong>\u540d(first_name)<\/strong><\/span>\u3092\u5c5e\u6027\u306b\u6301\u3064User\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001<span style=\"color: #339966\"><strong>\u59d3\u540d<\/strong><\/span>\u3092\u8fd4\u5374\u3059\u308b\u300c<span style=\"color: #339966\"><strong>full_name\u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u300d\u3092\u6301\u3064\u4ed5\u69d8\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306egenarete\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">rails g model user first_name:string last_name:string<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true\">Running via Spring preloader in process 17421\r\n invoke  active_record\r\n create    db\/migrate\/20180407090831_create_users.rb\r\n create    app\/models\/user.rb\r\n invoke    rspec\r\n create      \u3000spec\/models\/user_spec.rb<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u3092\u898b\u308b\u3068\u3001User\u30e2\u30c7\u30eb\u3068\u3068\u3082\u306b<span style=\"color: #0000ff\"><strong>\u30b9\u30da\u30c3\u30af\u304c\u81ea\u52d5\u4f5c\u6210<\/strong><\/span>\u3055\u308c\u305f\u306e\u304c\u308f\u304b\u308b\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3082\u3057\u3082\u65e2\u5b58\u306e\u30af\u30e9\u30b9\u304c\u3042\u308b\u5834\u5408\u306f\u3001<span style=\"color: #0000ff\"><strong>\u30b9\u30da\u30c3\u30af\u30d5\u30a1\u30a4\u30eb\u3092\u624b\u52d5\u3067\u4f5c\u6210<\/strong><\/span>\u3057\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u300cdb:migrate\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308c\u3070\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30b5\u30f3\u30d7\u30eb\u30e2\u30c7\u30eb\u306f\u4f5c\u6210\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">rails db:migrate<\/pre>\n<h3>\u671f\u5f85\u3059\u308b\u632f\u308b\u821e\u3044\u3092\u6587\u7ae0\u3067\u66f8\u304f<\/h3>\n<p>\u305d\u308c\u3067\u306f\u3001User\u30e2\u30c7\u30eb\u306e\u30b9\u30da\u30c3\u30af\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><span style=\"color: #0000ff\"><strong>\u30c6\u30b9\u30c8\u30d5\u30a1\u30fc\u30b9\u30c8\u306e\u8003\u3048\u65b9<\/strong><\/span>\u306f\u3001<\/p>\n<ol>\n<li>\u671f\u5f85\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u632f\u308b\u821e\u3044\u3092\u30b9\u30da\u30c3\u30af\u306b\u8a18\u8ff0\u3059\u308b<\/li>\n<li>\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u88c5\u3059\u308b<\/li>\n<\/ol>\n<p>\u3092\u7e70\u308a\u8fd4\u3059\u3053\u3068\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u306d\u3002<\/p>\n<p>\u305d\u306e\u6d41\u308c\u306b\u6cbf\u3063\u3066\u3001\u306f\u3058\u3081\u306bRSpec\u3067\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u306f\u3058\u3081\u306b\u767b\u5834\u3059\u308b<span style=\"color: #339966\"><strong>it \u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u306f\u3001\u30c6\u30b9\u30c8\u5bfe\u8c61\u306e\u30e1\u30bd\u30c3\u30c9\u304c<span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>\u3069\u306e\u3088\u3046\u306a\u632f\u308b\u821e\u3044\u3092\u3059\u308b\u304b<\/strong><\/span><\/strong><\/span>\u3092\u6587\u7ae0\u3067\u66f8\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li><span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>it(<\/strong><\/span><\/strong><\/span>&#8220;\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u632f\u308b\u821e\u3044\u3092\u6587\u7ae0\u3067\u8a18\u8ff0&#8221;<span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>)<\/strong><\/span><\/strong><\/span><\/li>\n<\/ul>\n<p>it \u30e1\u30bd\u30c3\u30c9\u306f<span style=\"color: #ff0000\"><strong>\u4f55\u304b\u306e\u51e6\u7406\u3092\u3059\u308b\u8a33\u3067\u306f\u306a\u304f<\/strong><\/span>\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4ed5\u69d8\u3092\u66f8\u304f\u30a4\u30e1\u30fc\u30b8\u3067\u3001\u5206\u304b\u308a\u3084\u3059\u3055\u306e\u305f\u3081\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u4f8b\u3067\u306ffull_name\u30e1\u30bd\u30c3\u30c9\u306b\u5bfe\u3059\u308b<span style=\"color: #339966\"><strong>it<\/strong><\/span>\u306e\u4f8b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>spec\/models\/user_spec.rb<\/p>\n<pre class=\"lang:ruby decode:true\">RSpec.describe User, type: :model do\r\n  it \"\u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\"\r\nend<\/pre>\n<p>RSpec\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">bundle exec rspec<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true\">*\r\nPending: (Failures listed here are expected and do not affect your suite's status)\r\n\r\n  1) User \u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\r\n     # Not yet implemented\r\n     # .\/spec\/models\/user_spec.rb:4\r\n\r\nFinished in 0.00512 seconds (files took 1.71 seconds to load)\r\n1 example, 0 failures, 1 pending<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\u306e\u6700\u5f8c\u3092\u898b\u308b\u3068<span style=\"color: #ff0000\"><strong>&#8220;1 pending&#8221;(\u4fdd\u7559\u4e2d 1\u4ef6)<\/strong><\/span>\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u4fdd\u7559\u4e2d\u306e\u7406\u7531\u306f\u3001it\u30e1\u30bd\u30c3\u30c9\u5185\u306b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u6b21\u9805\u306f\u3001it\u30e1\u30bd\u30c3\u30c9\u5185\u306b\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\uff01<\/p>\n<h3>\u671f\u5f85\u3059\u308b\u632f\u308b\u821e\u3044\u3092\u30b3\u30fc\u30c9\u3067\u66f8\u304f<\/h3>\n<p><span style=\"color: #339966\"><strong>expect\u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u306f\u30c6\u30b9\u30c8\u5bfe\u8c61\u3092\u691c\u8a3c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<ul>\n<li><span style=\"color: #0000ff\"><strong>expect(<\/strong><\/span>\u5b9f\u884c\u7d50\u679c<span style=\"color: #0000ff\"><strong>).to\u00a0<\/strong><\/span><span style=\"color: #339966\"><strong>eq<\/strong><\/span> \u671f\u5f85\u3059\u308b\u7d50\u679c<\/li>\n<\/ul>\n<p>\u6587\u7ae0\u306b\u3059\u308b\u3068\u300c\u5b9f\u884c\u7d50\u679c\u306f\u671f\u5f85\u7d50\u679c\u3068\u7b49\u3057\u3044\u3053\u3068\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #339966\"><strong>eq<\/strong><\/span>\u306f\u300c\u7b49\u3057\u3044\u3053\u3068\u300d\u3092\u610f\u5473\u3059\u308b\u69cb\u6587\u3067<span style=\"color: #339966\"><strong>matcher(\u30de\u30c3\u30c1\u30e3\u30fc)<\/strong><\/span>\u3068\u547c\u3070\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u3001full_name\u30e1\u30bd\u30c3\u30c9\u304c<span style=\"color: #339966\"><strong>\u59d3\u540d<\/strong><\/span>\u3092\u8fd4\u3059\u3053\u3068\u3092\u691c\u8a3c\u3059\u308b\u3001\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">it \"\u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\" do\r\n  user = User.new(\r\n          last_name:  \"\u4f8d\",\r\n          first_name: \"\u592a\u90ce\"\r\n  )\r\n  expect(user.full_name).to eq \"\u4f8d \u592a\u90ce\"\r\nend<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true\">$ bundle exec rspec\r\nF\r\n\r\nFailures:\r\n\r\n  1) User \u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\r\n     Failure\/Error: expect(user.full_name).to eq \"\u4f8d \u592a\u90ce\"\r\n\r\n     NoMethodError:\r\n       undefined method `full_name' for #&lt;User:0x00007fe445edbc10&gt;\r\n     # .\/spec\/models\/user_spec.rb:9:in `block (2 levels) in &lt;top (required)&gt;'\r\n\r\nFinished in 0.00875 seconds (files took 1.68 seconds to load)\r\n1 example, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec .\/spec\/models\/user_spec.rb:4 # User \u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068<\/pre>\n<p>\u6b8b\u5ff5\u306a\u304c\u3089\u3001&#8221;<span style=\"color: #ff0000\"><strong>Failed examples<\/strong><\/span>&#8220;\u3068\u306a\u3063\u3066\u30c6\u30b9\u30c8\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u539f\u56e0\u306f\u300cundefined method `full_name&#8217;\u300d\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u3001User\u30e2\u30c7\u30eb\u306b<span style=\"color: #ff0000\"><strong>full_name\u30e1\u30bd\u30c3\u30c9\u304c\u5b9f\u88c5\u3055\u308c\u3066\u3044\u306a\u3044<\/strong><\/span>\u3053\u3068\u304c\u539f\u56e0\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306e\u9805\u3067\u306f\u3001\u3053\u306e\u69cb\u6587\u30a8\u30e9\u30fc\u3092\u89e3\u6d88\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h3>\u30c6\u30b9\u30c8\u306b\u5931\u6557\u3059\u308b<\/h3>\n<p>\u69cb\u6587\u30a8\u30e9\u30fc\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306b<span style=\"color: #339966\"><strong>full_name\u30e1\u30bd\u30c3\u30c9<\/strong><\/span>\u3092\u4f5c\u6210\u3057\u3066\u518d\u5ea6\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>User\u30e2\u30c7\u30eb\u306b\u6b21\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">class User &lt; ApplicationRecord\r\n  def full_name\r\n    last_name + first_name\r\n  end\r\nend<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true\">$ bin\/bundle exec rspec\r\nF\r\n\r\nFailures:\r\n\r\n  1) User \u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\r\n     Failure\/Error: expect(user.full_name).to eq \"\u4f8d \u592a\u90ce\"\r\n\r\n       expected: \"\u4f8d \u592a\u90ce\"\r\n            got: \"\u4f8d\u592a\u90ce\"\r\n\r\n       (compared using ==)\r\n     # .\/spec\/models\/user_spec.rb:9:in `block (2 levels) in &lt;top (required)&gt;'\r\n\r\nFinished in 0.02584 seconds (files took 1.78 seconds to load)\r\n1 example, 1 failure\r\n\r\nFailed examples:\r\n\r\nrspec .\/spec\/models\/user_spec.rb:4 # User \u59d3\u3001\u540d\u3092\u767b\u9332\u3059\u308b\u3068\u3001\u59d3\u540d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068<\/pre>\n<p>Failed examples\u3068\u8868\u793a\u3055\u308c\u3001<span style=\"color: #ff0000\"><strong>\u518d\u3073\u30c6\u30b9\u30c8\u306b\u306f\u5931\u6557<\/strong><\/span>\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u3092\u898b\u308b\u3068\u3001<\/p>\n<ul>\n<li>expected: &#8220;\u4f8d \u592a\u90ce&#8221;\u00a0 \u2192\u00a0 \u00a0\u671f\u5f85\u3059\u308b\u7d50\u679c<\/li>\n<li>got:\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8220;\u4f8d\u592a\u90ce&#8221;\u00a0 \u2192\u00a0 \u00a0\u5b9f\u969b\u306e\u5024<\/li>\n<\/ul>\n<p>\u3068\u306a\u3063\u3066\u3001\u59d3\u3068\u540d\u306e\u9593\u306b\u30b9\u30da\u30fc\u30b9\u304c\u306a\u3044\u3053\u3068\u304c\u539f\u56e0\u306e\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u6b21\u9805\u3067\u3001\u3053\u306e\u30d0\u30b0\u3092\u89e3\u6d88\u3057\u3066\u30c6\u30b9\u30c8\u3092\u6210\u529f\u3055\u305b\u307e\u3057\u3087\u3046\uff01<\/p>\n<h3>\u30c6\u30b9\u30c8\u306b\u6210\u529f\u3059\u308b<\/h3>\n<p>full_name\u30e1\u30bd\u30c3\u30c9\u304c\u3001&#8221;\u4f8d \u592a\u90ce&#8221;\u3068\u7d50\u679c\u3092\u8fd4\u3059\u3088\u3046\u306b\u30d0\u30b0\u3092\u4fee\u6b63\u3057\u3066\u3001\u518d\u3073RSpec\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">class User &lt; ApplicationRecord\r\n  def full_name\r\n    last_name + \" \" + first_name  # \u59d3\u3068\u540d\u306e\u9593\u306b\u30b9\u30da\u30fc\u30b9\u3092\u8ffd\u52a0\r\n  end\r\nend<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c\uff1a<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">bin\/bundle exec rspec\r\n.\r\n\r\nFinished in 0.0122 seconds (files took 1.61 seconds to load)\r\n1 example, 0 failures<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u30a8\u30e9\u30fc\u8868\u793a\u304c\u306a\u304f\u306a\u308a<span style=\"color: #0000ff\"><strong>\u30c6\u30b9\u30c8\u304c\u6210\u529f<\/strong><\/span>\u3057\u305f\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\uff01<\/p>\n<h2>\u7279\u306b\u91cd\u8981\u306a\u69cb\u6587\u306e\u4f7f\u3044\u65b9<\/h2>\n<p>RSpec\u306f\u3068\u3066\u3082\u7c21\u5358\u306b\u59cb\u3081\u3089\u308c\u308b\u3053\u3068\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001RSpec\u306f\u3068\u3066\u3082<span style=\"color: #0000ff\"><strong>\u5f37\u529b\u306a\u30c6\u30b9\u30c8\u30c4\u30fc\u30eb<\/strong><\/span>\u3067\u3082\u3042\u308b\u306e\u3067\u3001\u305f\u304f\u3055\u3093\u3042\u308b\u69cb\u6587\u3084\u6a5f\u80fd\u306e\u3046\u3061<span style=\"color: #ff0000\"><strong>\u3069\u306e\u5834\u9762\u3067\u4f55\u3092\u4f7f\u3048\u3070\u3088\u3044\u304b\u304c\u308f\u304b\u3089\u306a\u3044<\/strong><\/span>\u3068\u3044\u3046\u65b9\u3082\u591a\u304f\u3044\u3089\u3063\u3057\u3083\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u4eca\u56de\u306f\u3001\u7279\u306b\u91cd\u8981\u306a<span style=\"color: #339966\"><strong>expect<\/strong><\/span>\u3068<span style=\"color: #339966\"><strong>matcher<\/strong><\/span>\u306e2\u70b9\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u89e6\u308c\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h3>expect<\/h3>\n<p><span style=\"color: #339966\"><strong>expect<\/strong><\/span>\u306f\u691c\u8a3c\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<ul>\n<li><span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>expect(<\/strong><\/span><\/strong><\/span>\u5b9f\u884c\u7d50\u679c<span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>).to<\/strong><\/span><\/strong><\/span> \u671f\u5f85\u3059\u308b\u7d50\u679c<\/li>\n<li><span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>expect(<\/strong><\/span><\/strong><\/span>\u5b9f\u884c\u7d50\u679c<span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>).not_to<\/strong><\/span><\/strong><\/span> \u671f\u5f85\u3059\u308b\u7d50\u679c<\/li>\n<\/ul>\n<p>\u5b9f\u884c\u4f8b\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n<table id=\"tablepress-355\" class=\"tablepress tablepress-id-355\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">\u5b9f\u884c\u4f8b<\/th><th class=\"column-2\">\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">expect(1 + 2).to eq 3<\/td><td class=\"column-2\">1 + 2 \u306e\u7d50\u679c\u304c 3\u3068\u7b49\u3057\u3044\u5834\u5408\u306f\u30c6\u30b9\u30c8\u6210\u529f<br \/>\n<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">expect(1 + 2).not_to eq 4<\/td><td class=\"column-2\">1 + 2 \u306e\u7d50\u679c\u304c 4\u3068\u7570\u306a\u308b\u5834\u5408\u306f\u30c6\u30b9\u30c8\u6210\u529f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-355 from cache -->\n<h3>matcher<\/h3>\n<p><span style=\"color: #339966\"><strong>matcher<\/strong><\/span>(\u30de\u30c3\u30c1\u30e3\u30fc)\u306f\u30c6\u30b9\u30c8\u5bfe\u8c61\u3068\u671f\u5f85\u3059\u308b\u7d50\u679c\u306e\u6bd4\u8f03\u6761\u4ef6\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>expect(\u5b9f\u884c\u7d50\u679c).to <span style=\"color: #339966\"><strong><span style=\"color: #0000ff\"><strong>eq\u00a0<\/strong><\/span><\/strong><\/span>\u671f\u5f85\u5024<\/li>\n<\/ul>\n<p>matcher\u306f\u8272\u3005\u306a\u30d0\u30ea\u30a8\u30fc\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n<table id=\"tablepress-356\" class=\"tablepress tablepress-id-356\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">matcher<\/th><th class=\"column-2\">\u5b9f\u884c\u4f8b<\/th><th class=\"column-3\">\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">eq( \u5024 )<\/td><td class=\"column-2\">expect(1 + 2).to eq 3<br \/>\n<\/td><td class=\"column-3\">1+2 \u306f 3 \u3068\u7b49\u3057\u3044\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">include( \u5024 )<\/td><td class=\"column-2\">expect([1,2,3]).to include 2<\/td><td class=\"column-3\">[1,2,3]\u306e\u914d\u5217\u306b2\u304c\u542b\u307e\u308c\u308b\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">be_truthy<\/td><td class=\"column-2\">expect(true).to be_truthy<\/td><td class=\"column-3\">\u5b9f\u884c\u7d50\u679c\u304ctrue\u3067\u3042\u308b\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">be_false<\/td><td class=\"column-2\">expect(false).to be_false<\/td><td class=\"column-3\">\u5b9f\u884c\u7d50\u679c\u304cfalse\u3067\u3042\u308b\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">match(\u6b63\u898f\u8868\u73fe)<\/td><td class=\"column-2\">expect(\"abc\").to match \/c$\/<\/td><td class=\"column-3\">\u201cabc\u201d\u306f\u201dc\u201d\u3067\u7d42\u308f\u308b\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">be_valid<\/td><td class=\"column-2\">expect(user).to be_valid<\/td><td class=\"column-3\">Rails\u306eUser\u30e2\u30c7\u30eb\u306evalidation\u306b\u6210\u529f\u3059\u308b\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">redirect_to(url)<\/td><td class=\"column-2\">expect(response).to redirect_to(\u201chttp:\/\/example.com\u201d)<\/td><td class=\"column-3\">Rails\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306f\u201chttp:\/\/example.com\u201d\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3053\u3068<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">render_template(url)<\/td><td class=\"column-2\">expect(response).to render_template(\u201cnew\u201d)<\/td><td class=\"column-3\">Rails\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306fnew\u30ec\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3053\u3068<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-356 from cache -->\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3044\u304b\u304b\u3067\u3057\u305f\u304b\uff1f<\/p>\n<p>\u4eca\u56de\u306f\u3001RSpec\u306e\u4f7f\u3044\u65b9\u3092\u4e2d\u5fc3\u306b\u57fa\u672c\u7684\u306a\u69cb\u6587\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>RSpec\u3092\u4f7f\u3046\u3068<span style=\"color: #0000ff\"><strong>\u30c6\u30b9\u30c8\u3092\u4f55\u5ea6\u3082\u81ea\u52d5\u5b9f\u884c<\/strong><\/span>\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001<span style=\"color: #0000ff\"><strong>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d0\u30b0\u3092\u6e1b\u3089\u3057\u305f\u308a\u3001\u54c1\u8cea\u3092\u4e0a\u3052\u305f\u308a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064<\/strong><\/span>\u305f\u3081\u3001\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001RSpec\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u5fd8\u308c\u3066\u3057\u307e\u3063\u305f\u3089\u3053\u306e\u8a18\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u30b7\u30b9\u30c6\u30e0\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u30aa\u30aa\u30a4\u30b7\u3067\u3059\u3002 RSpec(\u30a2\u30fc\u30eb\u30b9\u30da\u30c3\u30af)\u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f RSpec\u306f\u3001Ruby\u3084Ruby on Rails\u306e\u4ee3\u8868\u7684\u306a\u30c6\u30b9\u30c8\u30c4\u30fc\u30eb\u306e\u3053\u3068\u3067\u3001\u30af\u30e9\u30b9\u3084\u30e1\u30bd\u30c3\u30c9\u5358\u4f4d\u3067\u30c6\u30b9\u30c8\u3059\u308b\u305f\u3081\u306b\u5229 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":47859,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"swell_btn_cv_data":"","footnotes":""},"categories":[2352],"tags":[14],"class_list":["post-47847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-study","tag-ruby-on-rails"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sejuku.net\/blog\/47847\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sejuku.net\/blog\/47847\" \/>\n<meta property=\"og:site_name\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sejuku2013\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/sejuku2013\/\" \/>\n<meta property=\"article:published_time\" content=\"1970-01-01T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T02:46:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/04\/rspec.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/samuraijuku\" \/>\n<meta name=\"twitter:site\" content=\"@samuraijuku\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847\"},\"author\":{\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/e8ca7fd09857a736a25e6b4455a3ab61\"},\"headline\":\"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac\",\"datePublished\":\"1970-01-01T00:00:00+00:00\",\"dateModified\":\"2024-05-06T02:46:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847\"},\"wordCount\":163,\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/rspec.jpg\",\"keywords\":[\"Ruby on Rails\"],\"articleSection\":[\"Ruby\u5b66\u7fd2\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847\",\"name\":\"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/rspec.jpg\",\"datePublished\":\"1970-01-01T00:00:00+00:00\",\"dateModified\":\"2024-05-06T02:46:26+00:00\",\"description\":\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#primaryimage\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/rspec.jpg\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/04\\\/rspec.jpg\",\"width\":700,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/47847#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\",\"name\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"width\":600,\"height\":600,\"caption\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\",\"https:\\\/\\\/x.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\\\/featured\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/e8ca7fd09857a736a25e6b4455a3ab61\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g\",\"caption\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8\"},\"description\":\"\u3010\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3011 DX\u8a8d\u5b9a\u53d6\u5f97\u4e8b\u696d\u8005\u306b\u9078\u5b9a\u3055\u308c\u3066\u3044\u308b\u682a\u5f0f\u4f1a\u793eSAMURAI\u306e\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u30fb\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u90e8\u304c\u904b\u55b6\u3002\u300c\u8cea\u306e\u9ad8\u3044IT\u6559\u80b2\u3092\u3001\u3059\u3079\u3066\u306e\u4eba\u306b\u300d\u3092\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u3001IT\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3073\u59cb\u3081\u305f\u521d\u5b66\u8005\u306e\u65b9\u306b\u5411\u3051\u8a18\u4e8b\u3092\u57f7\u7b46\u3002 \u7d2f\u8a08\u6307\u5c0e\u8005\u65704\u4e075,000\u540d\u4ee5\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u300c\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u300d\u3001\u7d2f\u8a08\u767b\u9332\u8005\u65701\u4e078,000\u4eba\u4ee5\u4e0a\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u5b66\u7fd2\u30b5\u30fc\u30d3\u30b9\u300c\u4f8d\u30c6\u30e9\u30b3\u30e4\u300d\u3067\u6271\u3046\u6559\u6750\u958b\u767a\u306e\u30ce\u30a6\u30cf\u30a6\u30012013\u5e74\u306e\u5275\u696d\u304b\u3089\u904b\u55b6\u3067\u5f97\u305f\u77e5\u898b\u306b\u57fa\u3065\u304d\u3001\u8a18\u4e8b\u306e\u57f7\u7b46\u3060\u3051\u3067\u306a\u304f\u7de8\u96c6\u30fb\u76e3\u4fee\u3082\u62c5\u5f53\u3057\u3066\u3044\u307e\u3059\u3002 \u3010\u5c02\u9580\u5206\u91ce\u3011 IT\\\/Web\u958b\u767a\\\/AI\u30fb\u30ed\u30dc\u30c3\u30c8\u958b\u767a\\\/\u30a4\u30f3\u30d5\u30e9\u958b\u767a\\\/\u30b2\u30fc\u30e0\u958b\u767a\\\/AI\\\/Web\u30c7\u30b6\u30a4\u30f3\",\"sameAs\":[\"https:\\\/\\\/www.sejuku.net\\\/\",\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\\\/\",\"https:\\\/\\\/www.instagram.com\\\/samuraiengineer_official\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\"],\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/author\\\/samurai-blog\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sejuku.net\/blog\/47847","og_locale":"ja_JP","og_type":"article","og_title":"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","og_description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","og_url":"https:\/\/www.sejuku.net\/blog\/47847","og_site_name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","article_publisher":"https:\/\/www.facebook.com\/sejuku2013","article_author":"https:\/\/www.facebook.com\/sejuku2013\/","article_published_time":"1970-01-01T00:00:00+00:00","article_modified_time":"2024-05-06T02:46:26+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/04\/rspec.jpg","type":"image\/jpeg"}],"author":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/samuraijuku","twitter_site":"@samuraijuku","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sejuku.net\/blog\/47847#article","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/47847"},"author":{"name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/e8ca7fd09857a736a25e6b4455a3ab61"},"headline":"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac","datePublished":"1970-01-01T00:00:00+00:00","dateModified":"2024-05-06T02:46:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/47847"},"wordCount":163,"publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/47847#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/04\/rspec.jpg","keywords":["Ruby on Rails"],"articleSection":["Ruby\u5b66\u7fd2"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.sejuku.net\/blog\/47847","url":"https:\/\/www.sejuku.net\/blog\/47847","name":"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/47847#primaryimage"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/47847#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/04\/rspec.jpg","datePublished":"1970-01-01T00:00:00+00:00","dateModified":"2024-05-06T02:46:26+00:00","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","breadcrumb":{"@id":"https:\/\/www.sejuku.net\/blog\/47847#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sejuku.net\/blog\/47847"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/47847#primaryimage","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/04\/rspec.jpg","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/04\/rspec.jpg","width":700,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.sejuku.net\/blog\/47847#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sejuku.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Rails\u5165\u9580\u3011RSpec\u3092\u4f7f\u3063\u305f\u30c6\u30b9\u30c8\u65b9\u6cd5\u3092\u521d\u5fc3\u8005\u5411\u3051\u306b\u57fa\u672c\u304b\u3089\u89e3\u8aac"}]},{"@type":"WebSite","@id":"https:\/\/www.sejuku.net\/blog\/#website","url":"https:\/\/www.sejuku.net\/blog\/","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002","publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sejuku.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.sejuku.net\/blog\/#organization","name":"\u682a\u5f0f\u4f1a\u793eSAMURAI","url":"https:\/\/www.sejuku.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","width":600,"height":600,"caption":"\u682a\u5f0f\u4f1a\u793eSAMURAI"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sejuku2013","https:\/\/x.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g\/featured"]},{"@type":"Person","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/e8ca7fd09857a736a25e6b4455a3ab61","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/507c280c5c67d2c11fec4fdba20e5bf1ec2fe91f9deb42d2ec50382778b311bf?s=96&d=mm&r=g","caption":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u7de8\u96c6\u90e8"},"description":"\u3010\u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u3011 DX\u8a8d\u5b9a\u53d6\u5f97\u4e8b\u696d\u8005\u306b\u9078\u5b9a\u3055\u308c\u3066\u3044\u308b\u682a\u5f0f\u4f1a\u793eSAMURAI\u306e\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u30fb\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u90e8\u304c\u904b\u55b6\u3002\u300c\u8cea\u306e\u9ad8\u3044IT\u6559\u80b2\u3092\u3001\u3059\u3079\u3066\u306e\u4eba\u306b\u300d\u3092\u30df\u30c3\u30b7\u30e7\u30f3\u306b\u3001IT\u30fb\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3073\u59cb\u3081\u305f\u521d\u5b66\u8005\u306e\u65b9\u306b\u5411\u3051\u8a18\u4e8b\u3092\u57f7\u7b46\u3002 \u7d2f\u8a08\u6307\u5c0e\u8005\u65704\u4e075,000\u540d\u4ee5\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u300c\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u300d\u3001\u7d2f\u8a08\u767b\u9332\u8005\u65701\u4e078,000\u4eba\u4ee5\u4e0a\u306e\u30aa\u30f3\u30e9\u30a4\u30f3\u5b66\u7fd2\u30b5\u30fc\u30d3\u30b9\u300c\u4f8d\u30c6\u30e9\u30b3\u30e4\u300d\u3067\u6271\u3046\u6559\u6750\u958b\u767a\u306e\u30ce\u30a6\u30cf\u30a6\u30012013\u5e74\u306e\u5275\u696d\u304b\u3089\u904b\u55b6\u3067\u5f97\u305f\u77e5\u898b\u306b\u57fa\u3065\u304d\u3001\u8a18\u4e8b\u306e\u57f7\u7b46\u3060\u3051\u3067\u306a\u304f\u7de8\u96c6\u30fb\u76e3\u4fee\u3082\u62c5\u5f53\u3057\u3066\u3044\u307e\u3059\u3002 \u3010\u5c02\u9580\u5206\u91ce\u3011 IT\/Web\u958b\u767a\/AI\u30fb\u30ed\u30dc\u30c3\u30c8\u958b\u767a\/\u30a4\u30f3\u30d5\u30e9\u958b\u767a\/\u30b2\u30fc\u30e0\u958b\u767a\/AI\/Web\u30c7\u30b6\u30a4\u30f3","sameAs":["https:\/\/www.sejuku.net\/","https:\/\/www.facebook.com\/sejuku2013\/","https:\/\/www.instagram.com\/samuraiengineer_official\/","https:\/\/x.com\/https:\/\/twitter.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g"],"url":"https:\/\/www.sejuku.net\/blog\/author\/samurai-blog"}]}},"_links":{"self":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/47847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/comments?post=47847"}],"version-history":[{"count":0,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/47847\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media\/47859"}],"wp:attachment":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media?parent=47847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/categories?post=47847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/tags?post=47847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}